com.atlassian.studio.jira.importer
Interface ArchiveExtractor


public interface ArchiveExtractor

Extracts an archive


Nested Class Summary
static class ArchiveExtractor.ArchiveFormatException
          Used to indicate a invalid format, this usually means that the entries do not conform to the expected file/dir name structure.
static class ArchiveExtractor.Entry
          An entry for an archive
static interface ArchiveExtractor.EntryVisitor<R>
          Visitor for visiting entries, can be used to find out information about the structure of the archive before doing a full extraction.
static class ArchiveExtractor.Type
           
 
Method Summary
 void extractEntryTo(String entry, File output)
          Extract an archive entry to the passed file.
 void extractTo(File destination, String path, TaskProgressSink taskProgressSink)
          Extract the archive to the given destination
 ArchiveExtractor.Type getType()
          Return the type of archive to the caller.
<R> R
visitEntries(ArchiveExtractor.EntryVisitor<R> visitor)
          Visit the entries in the archive.
 

Method Detail

extractTo

void extractTo(File destination,
               String path,
               TaskProgressSink taskProgressSink)
               throws IOException
Extract the archive to the given destination

Parameters:
destination - The destination to extract the archive to
path - The in the archive to extract from
taskProgressSink - to monitor the extraction progress
Throws:
IOException - If an error occured

extractEntryTo

void extractEntryTo(String entry,
                    File output)
                    throws IOException
Extract an archive entry to the passed file.

Parameters:
entry - the entry in the archive to extract.
output - the file to output to.
Throws:
IOException - if an I/O error occurs while extracting the file.

visitEntries

<R> R visitEntries(ArchiveExtractor.EntryVisitor<R> visitor)
               throws IOException
Visit the entries in the archive. This is intended as a lightweight mechanism to find a little about the structure of the archive before doing a full unzip.

Type Parameters:
R - The type to return
Parameters:
visitor - The visitor to visit
Returns:
The result of the visitor
Throws:
IOException - If an error occured

getType

ArchiveExtractor.Type getType()
Return the type of archive to the caller.

Returns:
the type of archive.


Copyright © 2002-2012 Atlassian. All Rights Reserved.