[Mulgara-svn] r1814 - trunk/src/jar/resolver/java/org/mulgara/resolver
pag at mulgara.org
pag at mulgara.org
Tue Oct 6 06:45:59 UTC 2009
Author: pag
Date: 2009-10-05 23:45:58 -0700 (Mon, 05 Oct 2009)
New Revision: 1814
Modified:
trunk/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java
Log:
No longer canonicalizing URIs if they don't appear in the rmi scheme. The only exception is the system graph, which is always stored as relative.
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java 2009-10-06 06:44:48 UTC (rev 1813)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java 2009-10-06 06:45:58 UTC (rev 1814)
@@ -103,6 +103,15 @@
/** The name of the graph parameter in a URI */
static final String GRAPH = "graph";
+ /** The system URI scheme */
+ static final String RMI_SCHEME = "rmi";
+
+ /** The relative name of the system graph */
+ static final String SYSTEM_GRAPH_NAME = "#";
+
+ /** The relative URI for the system graph */
+ static final URI SYSTEM_GRAPH_URI = URI.create(SYSTEM_GRAPH_NAME);
+
/** The unique {@link URI} naming this database. */
private final URI databaseURI;
@@ -663,7 +672,8 @@
String scheme = uri.getScheme();
String fragment = uri.getFragment();
- if (scheme != null && scheme.equals(databaseURI.getScheme())) {
+ // we're only going to fiddle with this if the database scheme is RMI
+ if (scheme != null && scheme.equals(databaseURI.getScheme()) && scheme.equals(RMI_SCHEME)) {
if (databaseURI.isOpaque()) {
// databaseURI is opaque.
if (fragment != null && uri.isOpaque()) {
@@ -742,6 +752,12 @@
}
}
}
+ } else if (scheme != null && scheme.equals(databaseURI.getScheme())) {
+ // not RMI, but we still want to catch the system graph
+ if (uri.toString().equals(databaseURI.toString() + SYSTEM_GRAPH_NAME)) {
+ SPObjectFactory spObjectFactory = persistentStringPool.getSPObjectFactory();
+ spObject = spObjectFactory.newSPURI(SYSTEM_GRAPH_URI);
+ }
}
}
return spObject;
More information about the Mulgara-svn
mailing list