fedora.server.storage.types
Class DatastreamReferencedContent

java.lang.Object
  extended byfedora.server.storage.types.Datastream
      extended byfedora.server.storage.types.DatastreamReferencedContent

public class DatastreamReferencedContent
extends Datastream

Title: DatastreamReferencedContent.java

Description: Referenced Content.

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: DatastreamReferencedContent.java,v 1.13 2005/01/11 20:06:08 cwilper Exp $
Author:
cwilper@cs.cornell.edu

Field Summary
 
Fields inherited from class fedora.server.storage.types.Datastream
DatastreamAltIDs, DatastreamID, DSControlGrp, DSCreateDT, DSFormatURI, DSInfoType, DSLabel, DSLocation, DSLocationType, DSMIME, DSSize, DSState, DSVersionable, DSVersionID, isNew
 
Constructor Summary
DatastreamReferencedContent()
           
 
Method Summary
 java.io.InputStream getContentStream()
          Gets an InputStream to the content of this externally-referenced datastream.
 
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

getContentStream

public java.io.InputStream getContentStream()
                                     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