From f2666448aa5521f1421a2d4def8d0df26817ae15 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Tue, 15 Jun 2010 20:27:59 +0000
Subject: [PATCH] MINOR: More robust handling of URLs.

SVN: 16539
---
 .../generic/shared/api/v1/DataStoreApiUrlUtilities.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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 5c124f79b83..78e319b5522 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
@@ -46,7 +46,7 @@ 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("/"))
@@ -54,6 +54,11 @@ public class DataStoreApiUrlUtilities
             datastoreUrl = datastoreUrl.substring(0, datastoreUrl.length() - 1);
         }
 
+        if (false == datastoreUrl.endsWith(DATA_STORE_SERVER_WEB_APPLICATION_NAME))
+        {
+            datastoreUrl = datastoreUrl + "/" + DATA_STORE_SERVER_WEB_APPLICATION_NAME;
+        }
+
         return datastoreUrl;
     }
 
-- 
GitLab