org.fcrepo.server.storage.types
Class DatastreamReferencedContent

java.lang.Object
  extended by org.fcrepo.server.storage.types.Datastream
      extended by org.fcrepo.server.storage.types.DatastreamReferencedContent

public class DatastreamReferencedContent
extends Datastream

Referenced Content.

Version:
$Id$
Author:
Chris Wilper

Field Summary
 
Fields inherited from class org.fcrepo.server.storage.types.Datastream
autoChecksum, CHECKSUM_IOEXCEPTION, CHECKSUM_NONE, CHECKSUMTYPE_DISABLED, DatastreamAltIDs, DatastreamID, defaultChecksumType, DSChecksum, DSChecksumType, DSControlGrp, DSCreateDT, DSFormatURI, DSInfoType, DSLabel, DSLocation, DSLocationType, DSMIME, DSSize, DSState, DSVersionable, DSVersionID, isNew
 
Constructor Summary
DatastreamReferencedContent()
           
 
Method Summary
 Datastream copy()
           
 long getContentLength(MIMETypedStream stream)
          Returns the length of the content of this stream.
 InputStream getContentStream(Context context)
          Gets an InputStream to the content of this externally-referenced datastream.
 
Methods inherited from class org.fcrepo.server.storage.types.Datastream
compareChecksum, copy, getChecksum, getChecksumType, getContentStream, getContentStreamForChecksum, getDefaultChecksumType, setChecksum, validateChecksumType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatastreamReferencedContent

public DatastreamReferencedContent()
Method Detail

copy

public Datastream copy()
Overrides:
copy in class Datastream

getContentStream

public InputStream getContentStream(Context context)
                             throws StreamIOException
Gets an InputStream to the content of this externally-referenced datastream.

The DSLocation of this datastream must be non-null before invoking this method.

If successful, the DSMIME type is automatically set based on the web server's response header. If the web server doesn't send a valid Content-type: header, as a last resort, the content-type is guessed by using a map of common extensions to mime-types.

If the content-length header is present in the response, DSSize will be set accordingly.

Overrides:
getContentStream in class Datastream
Throws:
StreamIOException
See Also:
Datastream.getContentStream()

getContentLength

public long getContentLength(MIMETypedStream stream)
Returns the length of the content of this stream.

Parameters:
stream - the MIMETypedStream
Returns:
length the length of the content


Copyright © 2011 DuraSpace. All Rights Reserved.