diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/DataStoreApiUrlUtilities.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/DataStoreApiUrlUtilities.java index cd29c5f7290ffa36044550c5e6f25dec8bb34e90..5c124f79b839a246410268d7665add5c2a8b4a4d 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/DataStoreApiUrlUtilities.java +++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/DataStoreApiUrlUtilities.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.dss.generic.shared.api.v1; -import static ch.systemsx.cisd.openbis.generic.shared.GenericSharedConstants.DATA_STORE_SERVER_APPLICATION_PATH; import static ch.systemsx.cisd.openbis.generic.shared.GenericSharedConstants.DATA_STORE_SERVER_WEB_APPLICATION_NAME; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; @@ -47,30 +46,19 @@ public class DataStoreApiUrlUtilities public static String getDataStoreUrlFromServerUrl(String dataStoreServerUrl) { String datastoreUrl = dataStoreServerUrl; + // The url objained form a DataStore object is the *download* url. Convert this to the // datastore URL - if (datastoreUrl.endsWith(DATA_STORE_SERVER_WEB_APPLICATION_NAME)) - { - datastoreUrl = - datastoreUrl.substring(0, datastoreUrl.length() - - DATA_STORE_SERVER_WEB_APPLICATION_NAME.length()); - } - if (datastoreUrl.endsWith("/")) { datastoreUrl = datastoreUrl.substring(0, datastoreUrl.length() - 1); } - if (!datastoreUrl.endsWith(DATA_STORE_SERVER_APPLICATION_PATH)) - { - datastoreUrl = datastoreUrl + "/" + DATA_STORE_SERVER_APPLICATION_PATH; - } - return datastoreUrl; } public static String getUrlForRpcService(String serviceUrlSuffix) { - return "/" + DATA_STORE_SERVER_APPLICATION_PATH + serviceUrlSuffix; + return "/" + DATA_STORE_SERVER_WEB_APPLICATION_NAME + serviceUrlSuffix; } }