|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.view.ZipEntryDataSource
public class ZipEntryDataSource
The FileDataSource class implements a simple DataSource object that encapsulates a zip entry. It provides data typing services via a FileTypeMap object.
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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ZipEntryDataSource(java.util.zip.ZipFile zipFile,
java.util.zip.ZipEntry zipEntry)
public ZipEntryDataSource(byte[] data,
java.util.zip.ZipEntry zipEntry)
| Method Detail |
|---|
public java.lang.String getContentType()
getContentType in interface javax.activation.DataSource
public 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.DataSource
public 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.
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||