public class ZipEntryDataSource
extends java.lang.Object
implements javax.activation.DataSource
FileDataSource Typing Semantics:
The FileDataSource class delegates data typing of files to an object subclassed from the FileTypeMap class.The setFileTypeMap method can be used to explicitly set the FileTypeMap for an instance of FileDataSource. If no FileTypeMap is set, the FileDataSource will call the FileTypeMap's getDefaultFileTypeMap method to get the System's default FileTypeMap.
| Constructor and Description |
|---|
ZipEntryDataSource(byte[] data,
java.util.zip.ZipEntry zipEntry)
Creates a new instance of ZipEntryDataSource
from a ZipEntry object.
|
ZipEntryDataSource(java.util.zip.ZipFile zipFile,
java.util.zip.ZipEntry zipEntry)
Creates a new instance of ZipEntryDataSource
from a ZipEntry object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType()
This method returns the MIME type of the data in the form of a string.
|
java.io.InputStream |
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()
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() |
void |
setFileTypeMap(javax.activation.FileTypeMap map)
Set the FileTypeMap to use with this FileDataSource.
|
public ZipEntryDataSource(java.util.zip.ZipFile zipFile,
java.util.zip.ZipEntry zipEntry)
public ZipEntryDataSource(byte[] data,
java.util.zip.ZipEntry zipEntry)
public java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.lang.String getName()
getName in interface javax.activation.DataSourcepublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic void setFileTypeMap(javax.activation.FileTypeMap map)
map - The FileTypeMap for this object.