From: Kostas Papadimitriou Date: Fri, 31 May 2013 14:32:56 +0000 (+0300) Subject: Try to resolve api url from otherProperties X-Git-Tag: 0.14rc1~21 X-Git-Url: https://code.grnet.gr/git/pithos-web-client/commitdiff_plain/d2b953c5de6cc081869071b6fca3552b11edda0f Try to resolve api url from otherProperties check otherProperties.STORAGE_API_URL. Fallback to config defaults. Refs: #3884 --- diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index 84079df..9ff7b2b 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -93,7 +93,7 @@ public class Pithos implements EntryPoint, ResizeHandler { } public static final Configuration config = GWT.create(Configuration.class); - public static final String CONFIG_API_PATH = config.apiPath(); + public static final String CONFIG_API_PATH = getFromOtherPropertiesOrDefaultString("STORAGE_API_URL", config.apiPath()); static { LOG("CONFIG_API_PATH = ", CONFIG_API_PATH); } @@ -108,6 +108,14 @@ public class Pithos implements EntryPoint, ResizeHandler { return null; } } + public static String getFromOtherPropertiesOrDefaultString(String key, String dflt) { + try { + return otherProperties.get(key); + } + catch(Exception e) { + return dflt; + } + } public static final String OTHERPROPS_STORAGE_API_URL = getFromOtherPropertiesOrNull("STORAGE_API_URL"); public static final String OTHERPROPS_USER_CATALOGS_API_URL = getFromOtherPropertiesOrNull("USER_CATALOGS_API_URL"); static {