okapi.util
Class OkapiStoreDataSource

java.lang.Object
  extended by okapi.util.OkapiStoreDataSource
All Implemented Interfaces:
javax.activation.DataSource

public class OkapiStoreDataSource
extends java.lang.Object
implements javax.activation.DataSource

Class OkapiStoreDataSource

Version:
$Revision: 31044 $, $Date: 2008-09-02 17:08:01 -0400 (Tue, 02 Sep 2008) $
Author:
MIT Stellar team

Constructor Summary
OkapiStoreDataSource(OkapiStore store)
          Constructor OkapiStoreDataSource
 
Method Summary
 java.lang.String getContentType()
          Method getContentType This method returns the MIME type of the data in the form of a string.
 java.io.InputStream getInputStream()
          Method getInputStream This method returns an InputStream representing the the data and throws the appropriate exception if it can not do so.
 java.lang.String getName()
          Method getName Return the name of this object where the name of the object is dependant on the nature of the underlying objects.
 java.io.OutputStream getOutputStream()
          Method getOutputStream This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OkapiStoreDataSource

public OkapiStoreDataSource(OkapiStore store)
                     throws java.io.FileNotFoundException
Constructor OkapiStoreDataSource

Parameters:
store -
Throws:
java.io.FileNotFoundException
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Method getInputStream This method returns an InputStream representing the the data and throws the appropriate exception if it can not do so. Note that a new InputStream object must be returned each time this method is called, and the stream must be positioned at the beginning of the data.

Specified by:
getInputStream in interface javax.activation.DataSource
Returns:
java.io.InputStream
Throws:
java.io.IOException
See Also:
DataSource.getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Method getOutputStream This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so. Note that a new OutputStream object must be returned each time this method is called, and the stream must be positioned at the location the data is to be written.

Specified by:
getOutputStream in interface javax.activation.DataSource
Returns:
java.io.OutputStream
Throws:
java.io.IOException
See Also:
DataSource.getOutputStream()

getContentType

public java.lang.String getContentType()
Method getContentType This method returns the MIME type of the data in the form of a string. It should always return a valid type. It is suggested that getContentType return "application/octet-stream" if the DataSource implementation can not determine the data type.

Specified by:
getContentType in interface javax.activation.DataSource
Returns:
String
See Also:
DataSource.getContentType()

getName

public java.lang.String getName()
Method getName Return the name of this object where the name of the object is dependant on the nature of the underlying objects. DataSources encapsulating files may choose to return the filename of the object. (Typically this would be the last component of the filename, not an entire pathname.)

Specified by:
getName in interface javax.activation.DataSource
Returns:
String
See Also:
DataSource.getName()


Copyright ? 2001-2009 MIT. All Rights Reserved.