Permalink
Browse files

Utilize WrappableGraph to determine graphType text.

  • Loading branch information...
1 parent 6e0cb59 commit b7564178b8763b615d84f76120b53f384e1229bb @spmallette spmallette committed Mar 18, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 rexster-server/src/main/java/com/tinkerpop/rexster/GraphResource.java
@@ -1,6 +1,7 @@
package com.tinkerpop.rexster;
import com.tinkerpop.blueprints.pgm.Graph;
+import com.tinkerpop.blueprints.pgm.WrappableGraph;
import com.tinkerpop.blueprints.pgm.util.wrappers.readonly.ReadOnlyGraph;
import com.tinkerpop.rexster.extension.ExtensionMethod;
import com.tinkerpop.rexster.extension.ExtensionPoint;
@@ -79,10 +80,12 @@ private Response getGraph(String graphName, boolean showHypermedia) {
boolean isReadOnly = false;
String graphType = graph.getClass().getName();
- if (graph instanceof ReadOnlyGraph) {
- // readonly graphs must unwrap to the underlying graph implementation
- graphType = ((ReadOnlyGraph) graph).getRawGraph().getClass().getName();
- isReadOnly = true;
+ if (graph instanceof WrappableGraph) {
+ graphType = ((WrappableGraph) graph).getRawGraph().getClass().getName();
+
+ if (graph instanceof ReadOnlyGraph) {
+ isReadOnly = true;
+ }
}
this.resultObject.put(Tokens.READ_ONLY, isReadOnly);

0 comments on commit b756417

Please sign in to comment.