diff --git a/distro/changelog.xml b/distro/changelog.xml index 1181b78..6dd793c 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,8 @@ + + Constants definition moved on storage-manager-core Castants class + Added new Costants class for Junit package + Added new JUnit Test classes update JUnit Test Classes diff --git a/pom.xml b/pom.xml index 4aaa974..3f7bbd9 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.contentmanagement storage-manager-wrapper - 2.5.0-SNAPSHOT + 2.5.1-SNAPSHOT scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId} scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId} diff --git a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionById.java b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionById.java index 56bea42..e87fb4a 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionById.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionById.java @@ -9,10 +9,9 @@ import org.gcube.common.scope.api.ScopeProvider; import org.gcube.contentmanagement.blobstorage.service.IClient; import org.gcube.contentmanagement.blobstorage.service.operation.GetHttpUrl; import org.gcube.contentmanagement.blobstorage.service.operation.GetUrl; +import org.gcube.contentmanagement.blobstorage.transport.backend.util.Costants; import org.gcube.contentmanager.storageclient.wrapper.AccessType; -import org.gcube.contentmanager.storageclient.wrapper.Configuration; import org.gcube.contentmanager.storageclient.wrapper.MemoryType; -import org.gcube.contentmanager.storageclient.wrapper.ISClientConnector; import org.gcube.contentmanager.storageclient.wrapper.StorageClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +65,7 @@ public class SMPURLConnectionById extends SMPConnection { protected InputStream storageClient(String url) throws Exception { logger.info("url :" + url); - String [] urlParam=url.split(GetUrl.URL_SEPARATOR); + String [] urlParam=url.split(Costants.URL_SEPARATOR); String protocol=urlParam[0]; protocol=protocol.substring(0, protocol.length()-1); logger.debug("protocol is "+protocol); @@ -75,9 +74,9 @@ public class SMPURLConnectionById extends SMPConnection { } String encrypted=retrieveStringEncrypted(urlParam); MemoryType memory=null; - if(encrypted.contains(GetHttpUrl.VOLATILE_URL_IDENTIFICATOR)){ + if(encrypted.contains(Costants.VOLATILE_URL_IDENTIFICATOR)){ memory=MemoryType.VOLATILE; - encrypted=encrypted.replace(GetHttpUrl.VOLATILE_URL_IDENTIFICATOR, ""); + encrypted=encrypted.replace(Costants.VOLATILE_URL_IDENTIFICATOR, ""); } logger.debug("String encrypted "+encrypted); String phrase=retrieveEncryptionPhrase(); @@ -103,7 +102,7 @@ public class SMPURLConnectionById extends SMPConnection { String encrypted=urlParam[3]; int i=4; while(i < urlParam.length){ - encrypted=encrypted+GetUrl.URL_SEPARATOR+urlParam[i]; + encrypted=encrypted+Costants.URL_SEPARATOR+urlParam[i]; i++; } return encrypted; diff --git a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionFactory.java b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionFactory.java index 8dbec52..9b6a479 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionFactory.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionFactory.java @@ -12,6 +12,7 @@ import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.impl.ScopeBean; import org.gcube.common.scope.impl.ScopeBean.Type; import org.gcube.contentmanagement.blobstorage.service.operation.GetUrl; +import org.gcube.contentmanagement.blobstorage.transport.backend.util.Costants; import org.gcube.contentmanager.storageclient.protocol.utils.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +48,7 @@ public class SMPURLConnectionFactory { * @return */ private static boolean isIntermediateType(String urlString) { - String [] urlParam=urlString.split(GetUrl.URL_SEPARATOR); + String [] urlParam=urlString.split(Costants.URL_SEPARATOR); String infraHost=urlParam[2]; if(Utils.isScopeProviderMatch(infraHost)) return true; diff --git a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionOld.java b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionOld.java index 9888ce9..9f69dbf 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionOld.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/model/protocol/smp/SMPURLConnectionOld.java @@ -8,7 +8,6 @@ import java.net.URL; import org.gcube.common.scope.api.ScopeProvider; import org.gcube.contentmanagement.blobstorage.service.IClient; import org.gcube.contentmanager.storageclient.wrapper.AccessType; -import org.gcube.contentmanager.storageclient.wrapper.Configuration; import org.gcube.contentmanager.storageclient.wrapper.MemoryType; import org.gcube.contentmanager.storageclient.wrapper.StorageClient; import org.slf4j.Logger; diff --git a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java index 2939654..8b75d51 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java @@ -7,6 +7,7 @@ import org.gcube.contentmanager.storageclient.wrapper.MemoryType; import org.gcube.common.scope.api.ScopeProvider; import org.gcube.contentmanagement.blobstorage.service.IClient; import org.gcube.contentmanagement.blobstorage.service.impl.ServiceEngine; +import org.gcube.contentmanagement.blobstorage.transport.backend.util.Costants; import org.gcube.contentmanager.storageclient.protocol.utils.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -234,9 +235,9 @@ public class StorageClient { if(typeAccess == AccessType.PUBLIC){ clientID=""; }else if(typeAccess == AccessType.PRIVATE){ - clientID=ServiceEngine.FILE_SEPARATOR+"home"+ServiceEngine.FILE_SEPARATOR+serviceClass+ServiceEngine.FILE_SEPARATOR+serviceName+ServiceEngine.FILE_SEPARATOR+id; + clientID=Costants.FILE_SEPARATOR+"home"+Costants.FILE_SEPARATOR+serviceClass+Costants.FILE_SEPARATOR+serviceName+Costants.FILE_SEPARATOR+id; }else if(typeAccess==AccessType.SHARED){ - clientID=ServiceEngine.FILE_SEPARATOR+"home"+ServiceEngine.FILE_SEPARATOR+serviceClass+ServiceEngine.FILE_SEPARATOR+serviceName; + clientID=Costants.FILE_SEPARATOR+"home"+Costants.FILE_SEPARATOR+serviceClass+Costants.FILE_SEPARATOR+serviceName; }else{ throw new IllegalArgumentException("type is not correctly: public, private or shared"); }