From: Richard Millet Date: Sat, 2 May 2009 05:28:02 +0000 (+0000) Subject: CSPACE-84: Adding Client Library code to new source structure. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=5a559b332b0a5e0da50df0f65c187434e8ef2d8d;p=tmp%2Fjakarta-migration.git CSPACE-84: Adding Client Library code to new source structure. --- diff --git a/services/common/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java b/services/common/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java new file mode 100644 index 000000000..a24a19baa --- /dev/null +++ b/services/common/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java @@ -0,0 +1,32 @@ +package org.collectionspace.services.client; + +public abstract class CollectionSpaceClient { + static final String URL_PROPERTY = "org.collectionspace.url"; + /* + static final String URL_PROPERTY_SCHEME = "org.collectionspace.url.schme"; + static final String URL_PROPERTY_HOST = "org.collectionspace.url.host"; + static final String URL_PROPERTY_PORT = "org.collectionspace.url.port"; + static final String URL_PROPERTY_CONTEXT = "org.collectionspace.url.context"; + */ + + private static final String SCHEME = "http"; + private static final String HOST = "localhost"; + private static final String PORT = "8080"; + private static final String URI = "/helloworld/cspace-nuxeo"; + private static final String URL = SCHEME + "://" + + HOST + ":" + + PORT + + URI; + private String collectionSpaceURL = null; + + + String getURL() { + String result = collectionSpaceURL; + + if (collectionSpaceURL == null) { + result = collectionSpaceURL = System.getProperty(URL_PROPERTY, URL); + } + + return result; + } +}