[Mulgara-svn] r2008 - in trunk: data src/jar/content-mbox/java/org/mulgara/content/mbox src/jar/content-mp3/java/org/mulgara/content/mp3 src/jar/content-n3/java/org/mulgara/content/n3 src/jar/content-rdfa/java/org/mulgara/content/rdfa src/jar/resolver/java/org/mulgara/resolver src/jar/resolver-file/java/org/mulgara/resolver/file src/jar/resolver-http/java/org/mulgara/resolver/http src/jar/resolver-jar/java/org/mulgara/resolver/jar src/jar/resolver-spi/java/org/mulgara/content

alexhall at mulgara.org alexhall at mulgara.org
Tue Jul 19 18:15:41 UTC 2011


Author: alexhall
Date: 2011-07-19 18:15:40 +0000 (Tue, 19 Jul 2011)
New Revision: 2008

Added:
   trunk/data/rel-uri.rdf
   trunk/data/rel-uri.ttl
Modified:
   trunk/src/jar/content-mbox/java/org/mulgara/content/mbox/MBoxContentHandler.java
   trunk/src/jar/content-mp3/java/org/mulgara/content/mp3/MP3Statements.java
   trunk/src/jar/content-n3/java/org/mulgara/content/n3/N3WriterUnitTest.java
   trunk/src/jar/content-rdfa/java/org/mulgara/content/rdfa/RdfaStatementsUnitTest.java
   trunk/src/jar/resolver-file/java/org/mulgara/resolver/file/FileContent.java
   trunk/src/jar/resolver-http/java/org/mulgara/resolver/http/HttpContent.java
   trunk/src/jar/resolver-jar/java/org/mulgara/resolver/jar/JarContent.java
   trunk/src/jar/resolver-spi/java/org/mulgara/content/Content.java
   trunk/src/jar/resolver/java/org/mulgara/resolver/BasicDatabaseSessionUnitTest.java
   trunk/src/jar/resolver/java/org/mulgara/resolver/StreamContent.java
Log:
Modifications to the Content interface - remove unused getBlankNodeMap() method and add isStreaming() method instead of explicit check for content.getClass().equals("org.mulgara.resolver.StreamContent")

Added: trunk/data/rel-uri.rdf
===================================================================
--- trunk/data/rel-uri.rdf	                        (rev 0)
+++ trunk/data/rel-uri.rdf	2011-07-19 18:15:40 UTC (rev 2008)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:test="http://example.org/ns#">
+
+  <rdf:Description rdf:about="x">
+    <test:p>foo</test:p>
+  </rdf:Description>
+</rdf:RDF>
\ No newline at end of file

Added: trunk/data/rel-uri.ttl
===================================================================
--- trunk/data/rel-uri.ttl	                        (rev 0)
+++ trunk/data/rel-uri.ttl	2011-07-19 18:15:40 UTC (rev 2008)
@@ -0,0 +1,3 @@
+ at prefix : <http://example.org/ns#> .
+
+<x> :p "foo" .

Modified: trunk/src/jar/content-mbox/java/org/mulgara/content/mbox/MBoxContentHandler.java
===================================================================
--- trunk/src/jar/content-mbox/java/org/mulgara/content/mbox/MBoxContentHandler.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/content-mbox/java/org/mulgara/content/mbox/MBoxContentHandler.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -105,7 +105,7 @@
    */
   public boolean canParse(Content content) throws NotModifiedException {
 
-    if (content.getClass().getName().equals("org.mulgara.resolver.StreamContent")) {
+    if (content.isStreaming()) {
       log.info("Unable to parse streaming content in mbox content handler.");
       return false;
     }

Modified: trunk/src/jar/content-mp3/java/org/mulgara/content/mp3/MP3Statements.java
===================================================================
--- trunk/src/jar/content-mp3/java/org/mulgara/content/mp3/MP3Statements.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/content-mp3/java/org/mulgara/content/mp3/MP3Statements.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -115,7 +115,7 @@
    *
    * This is <code>null</code> if no parsing is in progress.
    */
-  private Map<Node,Long> blankNodeMap = null;
+  private Map<Node,Long> blankNodeMap = new HashMap<Node,Long>();
 
   //
   // Constructors
@@ -166,7 +166,7 @@
     }
 
     // Find the blank node map of our content object
-    blankNodeMap = convertToLocalBlankNodeMap(content.getBlankNodeMap());
+    blankNodeMap = null;
 
     // Load in the RDF conversion of the given mp3 content
     loadURL();
@@ -585,14 +585,5 @@
 
     return file;
   }
-
-  private Map<Node,Long> convertToLocalBlankNodeMap(Map<Object,BlankNode> map) {
-    Map<Node,Long> localMap = new HashMap<Node,Long>();
-    for (Map.Entry<Object,BlankNode> entry: map.entrySet()) {
-      if (entry.getKey() instanceof Node && entry.getValue() instanceof BlankNodeImpl) {
-        localMap.put((Node)entry.getKey(), ((BlankNodeImpl)entry.getValue()).getId());
-      }
-    }
-    return localMap;
-  }
+  
 }

Modified: trunk/src/jar/content-n3/java/org/mulgara/content/n3/N3WriterUnitTest.java
===================================================================
--- trunk/src/jar/content-n3/java/org/mulgara/content/n3/N3WriterUnitTest.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/content-n3/java/org/mulgara/content/n3/N3WriterUnitTest.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -20,23 +20,18 @@
 
 // Java 2 standard packages
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.StringWriter;
 import java.net.URI;
-import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-// Java 2 enterprise packages
 import javax.activation.MimeType;
 
-// Third party packages
 import junit.framework.TestCase;
-import org.jrdf.graph.BlankNode;
 
-// Locally written packages
 import org.mulgara.content.Content;
 import org.mulgara.resolver.spi.ResolverSession;
 import org.mulgara.resolver.spi.Statements;
@@ -166,11 +161,11 @@
       this.content = content;
     }
 
-    public Map<Object,BlankNode> getBlankNodeMap()         { return null; }
     public MimeType getContentType()                       { return null; }
     public URI getURI()                                    { return null; }
     public String getURIString()                           { return null; }
     public OutputStream newOutputStream()                  { return null; }
+    public boolean isStreaming()                           { return false; }
 
     public InputStream newInputStream() throws IOException {
       return new ByteArrayInputStream(content.getBytes("UTF-8"));

Modified: trunk/src/jar/content-rdfa/java/org/mulgara/content/rdfa/RdfaStatementsUnitTest.java
===================================================================
--- trunk/src/jar/content-rdfa/java/org/mulgara/content/rdfa/RdfaStatementsUnitTest.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/content-rdfa/java/org/mulgara/content/rdfa/RdfaStatementsUnitTest.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -24,23 +24,23 @@
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
-import junit.framework.*;        // JUnit unit testing framework
-import org.apache.log4j.Logger;  // Apache Log4J
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.log4j.Logger;
 import org.jrdf.graph.AbstractTriple;
-import org.jrdf.graph.BlankNode;
-import org.jrdf.graph.URIReference;
 import org.jrdf.graph.Node;
 import org.jrdf.graph.ObjectNode;
 import org.jrdf.graph.PredicateNode;
 import org.jrdf.graph.SubjectNode;
 import org.jrdf.graph.Triple;
+import org.jrdf.graph.URIReference;
 import org.mulgara.content.Content;
-// import org.mulgara.resolver.http.HttpContent;
 import org.mulgara.resolver.spi.ResolverSession;
 import org.mulgara.resolver.spi.Statements;
 import org.mulgara.resolver.spi.TestResolverSession;
@@ -226,7 +226,6 @@
     this.content = content;
   }
 
-  public Map<Object,BlankNode> getBlankNodeMap()         { return null; }
   public MimeType getContentType()                       {
     try {
       return new MimeType("text", "html");
@@ -235,6 +234,7 @@
   public URI getURI()                                    { return URI.create("http://examples.tobyinkster.co.uk/hcard"); }
   public String getURIString()                           { return "http://examples.tobyinkster.co.uk/hcard"; }
   public OutputStream newOutputStream()                  { return null; }
+  public boolean isStreaming()                           { return false; }
 
   public InputStream newInputStream() throws IOException {
     return new ByteArrayInputStream(content.getBytes("UTF-8"));

Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/BasicDatabaseSessionUnitTest.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/BasicDatabaseSessionUnitTest.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/BasicDatabaseSessionUnitTest.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -29,19 +29,38 @@
 
 // Java 2 standard packages
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
-// Third party packages
-import junit.framework.*;        // JUnit
-import org.apache.log4j.Logger;  // Log4J
-import org.jrdf.vocabulary.RDF;  // JRDF
+import javax.activation.MimeType;
+import javax.activation.MimeTypeParseException;
 
-// Locally written packages
-import org.mulgara.query.*;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.log4j.Logger;
+import org.jrdf.graph.ObjectNode;
+import org.jrdf.graph.PredicateNode;
+import org.jrdf.graph.SubjectNode;
+import org.jrdf.vocabulary.RDF;
+import org.mulgara.query.Answer;
+import org.mulgara.query.ArrayAnswer;
+import org.mulgara.query.ConstraintImpl;
+import org.mulgara.query.GraphResource;
+import org.mulgara.query.GraphUnion;
+import org.mulgara.query.Order;
+import org.mulgara.query.Query;
+import org.mulgara.query.SelectElement;
+import org.mulgara.query.UnconstrainedAnswer;
+import org.mulgara.query.Variable;
+import org.mulgara.query.rdf.LiteralImpl;
 import org.mulgara.query.rdf.Mulgara;
 import org.mulgara.query.rdf.URIReferenceImpl;
 import org.mulgara.server.Session;
@@ -110,6 +129,8 @@
     suite.addTest(new BasicDatabaseSessionUnitTest("testQuery1"));
     suite.addTest(new BasicDatabaseSessionUnitTest("testSetModel"));
     suite.addTest(new BasicDatabaseSessionUnitTest("testQuery2"));
+    suite.addTest(new BasicDatabaseSessionUnitTest("testSetModelRdfXml"));
+    //suite.addTest(new BasicDatabaseSessionUnitTest("testSetModelN3"));
 
     return suite;
   }
@@ -316,7 +337,99 @@
     }
   }
 
+  private static SubjectNode TEST_SUBJECT = new URIReferenceImpl(URI.create("http://example.org/base/x"));
+  private static PredicateNode TEST_PREDICATE = new URIReferenceImpl(URI.create("http://example.org/ns#p"));
+  private static ObjectNode TEST_OBJECT = new LiteralImpl("foo");
+  
+  private static final MimeType APPLICATION_RDF_XML;
+  private static final MimeType APPLICATION_N3;
 
+  static {
+    try {
+      APPLICATION_RDF_XML = new MimeType("application", "rdf+xml");
+      APPLICATION_N3 = new MimeType("application", "n3");
+    }
+    catch (MimeTypeParseException e) {
+      throw new ExceptionInInitializerError(e);
+    }
+  }
+  
+  public void testSetModelRdfXml() throws Exception {
+    URI graph = URI.create("test:graph");
+    URI base = URI.create("http://example.org/base/");
+    Session session = database.newSession();
+    try {
+      session.createModel(graph, null);
+      FileInputStream in = new FileInputStream("data/rel-uri.rdf");
+      try {
+        session.setModel(in, graph, base, APPLICATION_RDF_XML);
+      } finally {
+        in.close();
+      }
+      
+      assertHasData(session, graph, TEST_SUBJECT, TEST_PREDICATE, TEST_OBJECT);
+    } finally {
+      session.close();
+    }
+  }
+  
+  public void testSetModelN3() throws Exception {
+    URI graph = URI.create("test:graph");
+    URI base = URI.create("http://example.org/base/");
+    Session session = database.newSession();
+    try {
+      session.createModel(graph, null);
+      FileInputStream in = new FileInputStream("data/rel-uri.ttl");
+      try {
+        session.setModel(in, graph, base, APPLICATION_N3);
+      } finally {
+        in.close();
+      }
+      
+      assertHasData(session, graph, TEST_SUBJECT, TEST_PREDICATE, TEST_OBJECT);
+    } finally {
+      session.close();
+    }
+  }
+  
+  private static void assertHasData(Session session, URI graph, SubjectNode s, PredicateNode p, ObjectNode o) throws Exception {
+    Variable subjectVariable   = new Variable("subject");
+    Variable predicateVariable = new Variable("predicate");
+    Variable objectVariable    = new Variable("object");
+
+    List<SelectElement> selectList = new ArrayList<SelectElement>(3);
+    selectList.add(subjectVariable);
+    selectList.add(predicateVariable);
+    selectList.add(objectVariable);
+
+    // Evaluate the query
+    Answer a = session.query(new Query(
+      selectList,                                       // SELECT
+      new GraphResource(graph),                         // FROM
+      new ConstraintImpl(subjectVariable,               // WHERE
+                     predicateVariable,
+                     objectVariable),
+      null,                                             // HAVING
+      Collections.singletonList(                        // ORDER BY
+        new Order(subjectVariable, true)
+      ),
+      null,                                             // LIMIT
+      0,                                                // OFFSET
+      true,                                             // DISTINCT
+      new UnconstrainedAnswer()                         // GIVEN
+    ));
+    
+    try {
+      assertTrue(a.next());
+      assertEquals(s, a.getObject(0));
+      assertEquals(p, a.getObject(1));
+      assertEquals(o, a.getObject(2));
+      assertFalse(a.next());
+    } finally {
+      a.close();
+    }
+  }
+
   //
   // Internal methods
   //

Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/StreamContent.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/StreamContent.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/StreamContent.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -32,12 +32,9 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.activation.MimeType;
 
-import org.jrdf.graph.BlankNode;
 import org.mulgara.content.Content;
 
 /**
@@ -55,12 +52,6 @@
  */
 class StreamContent implements Content {
 
-  /**
-   * A map containing any format-specific blank node mappings from previous
-   * parses of this file.
-   */
-  private final Map<Object,BlankNode> blankNodeMap = new HashMap<Object,BlankNode>();
-
   /** The wrapped uri to assist with InputStream content detection. */
   private URI uri;
 
@@ -115,10 +106,6 @@
   // Methods implementing Content
   //
 
-  public Map<Object,BlankNode> getBlankNodeMap() {
-    return blankNodeMap;
-  }
-
   /**
    * @return {@inheritDoc}; always returns <code>null</code> because Java
    *   {@link java.io.File}s don't have any inherent MIME type
@@ -135,6 +122,11 @@
     return uri;
   }
 
+  /** We wrap an input stream, which may only be consumed once. */
+  public boolean isStreaming() {
+    return true;
+  }
+
   /**
    * Returns the inputstream supplied by the client  
    * 

Modified: trunk/src/jar/resolver-file/java/org/mulgara/resolver/file/FileContent.java
===================================================================
--- trunk/src/jar/resolver-file/java/org/mulgara/resolver/file/FileContent.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver-file/java/org/mulgara/resolver/file/FileContent.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -28,16 +28,21 @@
 package org.mulgara.resolver.file;
 
 // Java 2 standard packages
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.URI;
-import java.util.*;
-import java.util.zip.*;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
 
-// Java 2 enterprise packages
 import javax.activation.MimeType;
 
-// Local packages
-import org.jrdf.graph.BlankNode;
 import org.mulgara.content.Content;
 
 /**
@@ -56,12 +61,6 @@
 public class FileContent implements Content {
 
   /**
-   * A map containing any format-specific blank node mappings from previous
-   * parses of this file.
-   */
-  private final Map<Object,BlankNode> blankNodeMap = new HashMap<Object,BlankNode>();
-
-  /**
    * The wrapped file.
    */
   private File file;
@@ -90,10 +89,6 @@
   // Methods implementing Content
   //
 
-  public Map<Object,BlankNode> getBlankNodeMap() {
-    return blankNodeMap;
-  }
-
   /**
    * @return {@inheritDoc}; always returns <code>null</code> because Java
    *   {@link File}s don't have any inherent MIME type
@@ -106,6 +101,12 @@
     return file.toURI();
   }
 
+  /** The file can be re-opened as many times as desired. */
+  public boolean isStreaming() {
+    return false;
+  }
+
+
   public InputStream newInputStream() throws IOException {
     InputStream inputStream = new FileInputStream(file);
 

Modified: trunk/src/jar/resolver-http/java/org/mulgara/resolver/http/HttpContent.java
===================================================================
--- trunk/src/jar/resolver-http/java/org/mulgara/resolver/http/HttpContent.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver-http/java/org/mulgara/resolver/http/HttpContent.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -28,28 +28,35 @@
 package org.mulgara.resolver.http;
 
 // Java 2 standard packages
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.net.UnknownHostException;
-import java.util.*;
+import java.util.Enumeration;
 
-// Java 2 enterprise packages
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParameterList;
 import javax.activation.MimeTypeParseException;
 
-//Third party packages
-import org.apache.commons.httpclient.*;  // Apache HTTP Client
-import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.ConnectionPoolTimeoutException;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpConnection;
+import org.apache.commons.httpclient.HttpConnectionManager;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.SimpleHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.*;
-import org.apache.log4j.Logger;          // Apache Log4J
-
-//Local packages
-import org.jrdf.graph.BlankNode;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.HeadMethod;
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.log4j.Logger;
 import org.mulgara.content.Content;
 import org.mulgara.content.NotModifiedException;
 
@@ -79,12 +86,6 @@
   /** The MIME type of this data */
   private MimeType contentType = null;
 
-  /**
-   * A map containing any format-specific blank node mappings from previous
-   * parses of this file.
-   */
-  private Map<Object,BlankNode> blankNodeMap = new HashMap<Object,BlankNode>();
-
   /** Connection host <code>host</code> */
   private String host;
 
@@ -146,15 +147,6 @@
   }
 
   /**
-   * Retrieves the node map used to ensure that blank nodes are consistent.
-   * 
-   * @return The node map used to ensure that blank nodes are consistent
-   */
-  public Map<Object,BlankNode> getBlankNodeMap() {
-    return blankNodeMap;
-  }
-
-  /**
    * Obtain the approrpriate connection method
    * 
    * @param methodType can be HEAD or GET
@@ -365,6 +357,12 @@
     return httpUri;
   }
 
+  /** The stream can be re-opened, so return false. */
+  public boolean isStreaming() {
+    return false;
+  }
+
+
   /**
    * Creates an input stream to the resource whose content we are representing.
    * 

Modified: trunk/src/jar/resolver-jar/java/org/mulgara/resolver/jar/JarContent.java
===================================================================
--- trunk/src/jar/resolver-jar/java/org/mulgara/resolver/jar/JarContent.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver-jar/java/org/mulgara/resolver/jar/JarContent.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -31,17 +31,14 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
-import org.jrdf.graph.BlankNode;
 import org.mulgara.content.Content;
 
 /**
@@ -60,11 +57,6 @@
  *          </a>
  */
 public class JarContent implements Content {
-  /**
-   * A map containing any format-specific blank node mappings from previous
-   * parses of this file.
-   */
-  private Map<Object,BlankNode> blankNodeMap = new HashMap<Object,BlankNode>();
 
   /** The wrapped URL. */
   private URL url;
@@ -95,15 +87,6 @@
     urlUri = new URI(url.toExternalForm());
   }
 
-  /**
-   * Retrieves the node map used to ensure that blank nodes are consistent.
-   *
-   * @return The node map used to ensure that blank nodes are consistent
-   */
-  public Map<Object,BlankNode> getBlankNodeMap() {
-    return blankNodeMap;
-  }
-
   public MimeType getContentType() {
     try {
       return new MimeType(url.openConnection().getContentType());
@@ -123,6 +106,12 @@
     return urlUri;
   }
 
+  /** The archive can be re-opened as many times as necessary. */
+  public boolean isStreaming() {
+    return false;
+  }
+
+
   /**
    * Creates an input stream to the resource whose content we are representing.
    *

Modified: trunk/src/jar/resolver-spi/java/org/mulgara/content/Content.java
===================================================================
--- trunk/src/jar/resolver-spi/java/org/mulgara/content/Content.java	2011-07-19 15:54:06 UTC (rev 2007)
+++ trunk/src/jar/resolver-spi/java/org/mulgara/content/Content.java	2011-07-19 18:15:40 UTC (rev 2008)
@@ -28,17 +28,13 @@
 package org.mulgara.content;
 
 // Java 2 standard packages
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URI;
-import java.util.Map;
 
-// Java 2 enterprise packages
 import javax.activation.MimeType;
 
-import org.jrdf.graph.BlankNode;
-
 /**
  * Content is a sequence of bytes, along with optional metadata describing
  * the stream.  This can include a URI indentifying its source; or a MimeType
@@ -54,14 +50,6 @@
  * @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
  */
 public interface Content {
-  /**
-   * A map attached to the 'scope' of the content object containing a
-   * mapping from ContentHandler specific identifiers to blank nodes from
-   * previous parses of this content.  Never <code>null</code>.
-   *
-   * @return Map<Object,BlankNode>
-   */
-  public Map<Object,BlankNode> getBlankNodeMap();
 
   /**
    * The MIME type of the content, if any.
@@ -83,6 +71,14 @@
   public URI getURI();
 
   /**
+   * Determines whether this content is streaming. If the content is streaming, then the
+   * {@link #newInputStream()} method may be called only once; if not, then the client may
+   * create and consume multiple input streams.
+   * @return <tt>true</tt> if the content is streaming, else <tt>false</tt>.
+   */
+  public boolean isStreaming();
+  
+  /**
    * @return a content stream
    * @throws NotModifiedException if the cache validates against the source
    *   server and should be used instead of opening a new stream



More information about the Mulgara-svn mailing list