org.sf.cafebabe.activation
Class ArchivedDataSource

java.lang.Object
  extended by org.sf.cafebabe.activation.ArchivedDataSource
All Implemented Interfaces:
javax.activation.DataSource

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

This class represents data source from the archive entry.

Version:
1.0 03/04/2002
Author:
Alexander Shvets

Constructor Summary
ArchivedDataSource(java.util.zip.ZipFile zipFile, java.lang.String entryName)
          Creates new data source for the archive entry
 
Method Summary
 java.lang.String getContentType()
          Gets te content type of the data.
 java.io.InputStream getInputStream()
          Gets the source as an input stream
 java.lang.String getName()
          Gets the name of this source
 java.io.OutputStream getOutputStream()
          This source could not be represented as output stream, because saving in archive is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchivedDataSource

public ArchivedDataSource(java.util.zip.ZipFile zipFile,
                          java.lang.String entryName)
Creates new data source for the archive entry

Parameters:
zipFile - the zip file
entryName - the entry name
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets the source as an input stream

Specified by:
getInputStream in interface javax.activation.DataSource
Returns:
the input stream
Throws:
java.io.IOException - the I/O exception

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
This source could not be represented as output stream, because saving in archive is not supported.

Specified by:
getOutputStream in interface javax.activation.DataSource
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Gets te content type of the data. If the type cannot be determined, the "application/octet-stream" is used.

Specified by:
getContentType in interface javax.activation.DataSource
Returns:
the MIME type of the data in the form of a string.

getName

public java.lang.String getName()
Gets the name of this source

Specified by:
getName in interface javax.activation.DataSource
Returns:
the name of this source


Copyright 2006 Dream Programs Inc.. All Rights Reserved.