|
||||||||||
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.AttachmentZipEntries
|
static interface |
AttachmentZipKit.AttachmentZipEntry
These are the data returned about entries in a zip file |
static class |
AttachmentZipKit.FileCriteria
|
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 file)
This will return true if the file is in fact a valid zip file. |
AttachmentZipKit.AttachmentZipEntries |
listEntries(File zipFile,
int maxEntries,
AttachmentZipKit.FileCriteria criteria)
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 file)
file
- 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 entryIndex or the entry is a directory then null will be returned.
zipFile
- the zip file in playentryIndex
- the entryIndex 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.AttachmentZipEntries listEntries(File zipFile, int maxEntries, AttachmentZipKit.FileCriteria criteria) throws IOException
AttachmentZipKit.AttachmentZipEntry
s for a given zip file
zipFile
- the ZIP file in playcriteria
- the criteria of which entries to returnmaxEntries
- 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 |