+ public static final String CONFIG_API_PATH = config.apiPath();
+ static {
+ LOG("CONFIG_API_PATH = ", CONFIG_API_PATH);
+ }
+
+ public static final Dictionary otherProperties = Dictionary.getDictionary(Const.OTHER_PROPERTIES);
+ public static String getFromOtherPropertiesOrNull(String key) {
+ try {
+ return otherProperties.get(key);
+ }
+ catch(Exception e) {
+ LOGError(e);
+ return null;
+ }
+ }
+ 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 {
+ LOG("STORAGE_API_URL = ", OTHERPROPS_STORAGE_API_URL);
+ LOG("USER_CATALOGS_API_URL = ", OTHERPROPS_USER_CATALOGS_API_URL);
+ }
+
+ public static final String STORAGE_API_URL;
+ static {
+ if(OTHERPROPS_STORAGE_API_URL != null) {
+ STORAGE_API_URL = OTHERPROPS_STORAGE_API_URL;
+ }
+ else if(CONFIG_API_PATH != null) {
+ STORAGE_API_URL = CONFIG_API_PATH;
+ }
+ else {
+ throw new RuntimeException("Unknown STORAGE_API_URL");
+ }
+ }
+ public static final String USER_CATALOGS_API_URL;
+ static {
+ if(OTHERPROPS_USER_CATALOGS_API_URL != null) {
+ USER_CATALOGS_API_URL = OTHERPROPS_USER_CATALOGS_API_URL;
+ }
+ else if(OTHERPROPS_STORAGE_API_URL != null) {
+ throw new RuntimeException("STORAGE_API_URL is defined but USER_CATALOGS_API_URL is not");
+ }
+ else {
+ // https://server.com/v1/ --> https://server.com
+ String url = CONFIG_API_PATH;
+ url = Helpers.stripTrailing(url, "/");
+ url = Helpers.upToIncludingLastPart(url, "/");
+ url = Helpers.stripTrailing(url, "/");
+ url = url + "/user_catalogs";
+
+ USER_CATALOGS_API_URL = url;
+
+ LOG("USER_CATALOGS_API_URL = ", USER_CATALOGS_API_URL);
+ }
+ }