|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.attachment.AttachmentZipKit
public class AttachmentZipKit
This class will help when working with zip files
Nested Class Summary | |
---|---|
static interface |
AttachmentZipKit.AttachmentZipEntry
These are the data returned about entries in a zip file |
static interface |
AttachmentZipKit.AttachmentZipEntryList<E>
|
static class |
AttachmentZipKit.ZipEntryInputStream
|
Constructor Summary | |
---|---|
AttachmentZipKit()
|
Method Summary | |
---|---|
AttachmentZipKit.ZipEntryInputStream |
extractFile(File zipFile,
long entryIndex)
This will extract an OutputStream of the contents of the file at entryIndex within the zip file. |
boolean |
isZip(File zipFile)
This will return true if the file is in fact a valid zip file |
AttachmentZipKit.AttachmentZipEntryList<AttachmentZipKit.AttachmentZipEntry> |
listFile(File zipFile,
int maxEntries)
This will return a list of AttachmentZipKit.AttachmentZipEntry s for a given zip file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttachmentZipKit()
Method Detail |
---|
public boolean isZip(File zipFile)
zipFile
- the file in play
public AttachmentZipKit.ZipEntryInputStream extractFile(File zipFile, long entryIndex) throws IOException
OutputStream
of the contents of the file at entryIndex within the zip file.
If no file can be found be at that index or the entry is a directory then null will be returned.
zipFile
- the zip file in playentryIndex
- the index of the entry to return
AttachmentZipKit.ZipEntryInputStream
that can be read from
for data and has extra ZipEntry
information
IOException
- if things go wrong during readingpublic AttachmentZipKit.AttachmentZipEntryList<AttachmentZipKit.AttachmentZipEntry> listFile(File zipFile, int maxEntries) throws IOException
AttachmentZipKit.AttachmentZipEntry
s for a given zip file
zipFile
- the ZIP file in playmaxEntries
- the maximum number of entries to put in th list. If this is -negative then not maximum is
used.
IOException
- if the file cant be read and ZipException
if the the file is not a zip
file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |