Improvements repository validation constraints (#626)
* Add html tag Validator on strings. Add string trim. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Revert unintended changes. Sonar issues. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove weired comment. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Raise EclipseLink due to validation problem. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix permission. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Colour field test. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix sonar issues. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -10,11 +10,11 @@ package org.eclipse.hawkbit.artifact.repository;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact;
|
||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* ArtifactRepository service interface.
|
||||
|
||||
@@ -48,20 +48,26 @@ public class DownloadArtifactCache {
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
if (this == obj) {
|
||||
return true;
|
||||
if (obj == null)
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final DownloadArtifactCache other = (DownloadArtifactCache) obj;
|
||||
if (downloadType != other.downloadType)
|
||||
if (downloadType != other.downloadType) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,11 +90,11 @@ public class TenantAwareCacheManager implements TenancyCacheManager {
|
||||
getCacheNames(tenant).forEach(cachename -> delegate.getCache(buildKey(tenant, cachename)).clear());
|
||||
}
|
||||
|
||||
private boolean isTenantInvalid(final String tenant) {
|
||||
private static boolean isTenantInvalid(final String tenant) {
|
||||
return tenant == null || tenant.contains(TENANT_CACHE_DELIMITER);
|
||||
}
|
||||
|
||||
private String buildKey(final String tenant, final String cacheName) {
|
||||
private static String buildKey(final String tenant, final String cacheName) {
|
||||
return tenant + TENANT_CACHE_DELIMITER + cacheName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user