From 5a559b332b0a5e0da50df0f65c187434e8ef2d8d Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Sat, 2 May 2009 05:28:02 +0000 Subject: [PATCH] CSPACE-84: Adding Client Library code to new source structure. --- .../client/CollectionSpaceClient.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 services/common/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java 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; + } +} -- 2.47.3