Revision: 8467
http://sourceforge.net/p/bigdata/code/8467
Author: thompsonbry
Date: 2014-06-11 14:47:13 +0000 (Wed, 11 Jun 2014)
Log Message:
-----------
Adds error checking for the namespace argument for the createRepository() method.
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java
branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-06-11 13:13:13 UTC (rev 8466)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-06-11 14:47:13 UTC (rev 8467)
@@ -234,6 +234,16 @@
private volatile String queryMethod;
/**
+ * The name of the property whose value is the namespace of the KB to be
+ * created.
+ * <p>
+ * Note: This string is identicial to one defined by the BigdataSail
+ * options, but the client API must not include a dependency on the Sail so
+ * it is given by value again here in a package local scope.
+ */
+ static final String OPTION_CREATE_KB_NAMESPACE = "com.bigdata.rdf.sail.namespace";
+
+ /**
* Return the maximum requestURL length before the request is converted into
* a POST using a <code>application/x-www-form-urlencoded</code> request
* entity.
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java 2014-06-11 13:13:13 UTC (rev 8466)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepositoryManager.java 2014-06-11 14:47:13 UTC (rev 8467)
@@ -247,6 +247,14 @@
public void createRepository(final String namespace,
final Properties properties) throws Exception {
+ if (namespace == null)
+ throw new IllegalArgumentException();
+ if (properties == null)
+ throw new IllegalArgumentException();
+ if (properties.getProperty(OPTION_CREATE_KB_NAMESPACE) == null)
+ throw new IllegalArgumentException("Property not defined: "
+ + OPTION_CREATE_KB_NAMESPACE);
+
final ConnectOptions opts = newConnectOptions(baseServiceURL
+ "/namespace");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|