Project CASUAL
API for CASUAL
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CASUAL.archiving.Unzip Class Reference

Public Member Functions

 Unzip (File f) throws ZipException, IOException
 
 Unzip (String f) throws ZipException, IOException
 
File[] unzipFile (String outputFolder) throws ZipException, IOException
 
void close ()
 
String deployFileFromZip (Object entry, String outputFolder) throws ZipException, IOException
 
BufferedInputStream streamFileFromZip (Object entry) throws ZipException, IOException
 
String getEntryName (Object entry)
 
ZipEntry getEntry (Object entry)
 
String toString ()
 
 Unzip (File f) throws ZipException, IOException
 
 Unzip (String f) throws ZipException, IOException
 
File[] unzipFile (String outputFolder) throws ZipException, IOException
 
void close ()
 
String deployFileFromZip (Object entry, String outputFolder) throws ZipException, IOException
 
BufferedInputStream streamFileFromZip (Object entry) throws ZipException, IOException
 
String getEntryName (Object entry)
 
ZipEntry getEntry (Object entry)
 
String toString ()
 

Static Public Member Functions

static void unZipResource (CASUALSessionData sd, String zipResource, String outputFolder) throws FileNotFoundException, IOException
 
static ArrayList< File > unZipInputStream (CASUALSessionData sd, InputStream zStream, String outputFolder) throws FileNotFoundException, IOException
 
static BufferedInputStream streamFileFromZip (File zipFile, Object entry) throws ZipException, IOException
 
static void unZipResource (CASUALSessionData sd, String zipResource, String outputFolder) throws FileNotFoundException, IOException
 
static ArrayList< File > unZipInputStream (CASUALSessionData sd, InputStream zStream, String outputFolder) throws FileNotFoundException, IOException
 
static BufferedInputStream streamFileFromZip (File zipFile, Object entry) throws ZipException, IOException
 

Public Attributes

Enumeration<?extends ZipEntry > zipFileEntries
 

Detailed Description

Provides methods of accessing Unzip tools.

Author
Adam Outler adamo.nosp@m.utle.nosp@m.r@gma.nosp@m.il.c.nosp@m.om

Constructor & Destructor Documentation

CASUAL.archiving.Unzip.Unzip ( File  f) throws ZipException, IOException

Unzip class is used to create a wrapper for unziping .zip files.

The File f will be converted to a ZipFile, and all other operations will be preformed on this ZipFile.

Parameters
fjava file object to be unziped.
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
ZipFile
CASUAL.archiving.Unzip.Unzip ( String  f) throws ZipException, IOException

Unzip class is used to create a wrapper for unziping .zip files.

The String f will be converted into a file, then that file will be converted into a ZipFile.

Parameters
fString location of file to be unziped.
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
ZipFile
CASUAL.archiving.Unzip.Unzip ( File  f) throws ZipException, IOException

Unzip class is used to create a wrapper for unziping .zip files.

The File f will be converted to a ZipFile, and all other operations will be preformed on this ZipFile.

Parameters
fjava file object to be unziped.
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
ZipFile
CASUAL.archiving.Unzip.Unzip ( String  f) throws ZipException, IOException

Unzip class is used to create a wrapper for unziping .zip files.

The String f will be converted into a file, then that file will be converted into a ZipFile.

Parameters
fString location of file to be unziped.
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
ZipFile

Member Function Documentation

void CASUAL.archiving.Unzip.close ( )

Closes the zip file

Should be called after all file operations have been completed in Unzip

void CASUAL.archiving.Unzip.close ( )

Closes the zip file

Should be called after all file operations have been completed in Unzip

String CASUAL.archiving.Unzip.deployFileFromZip ( Object  entry,
String  outputFolder 
) throws ZipException, IOException

Deploys a single file from a zip.

Takes in an ZipEntry, and writes that single zip entry out to a folder

Parameters
entryentry file to deploy
outputFolderfolder to be deployed to
Returns
location of entry deployed
Exceptions
ZipException
IOException
String CASUAL.archiving.Unzip.deployFileFromZip ( Object  entry,
String  outputFolder 
) throws ZipException, IOException

Deploys a single file from a zip.

Takes in an ZipEntry, and writes that single zip entry out to a folder

Parameters
entryentry file to deploy
outputFolderfolder to be deployed to
Returns
location of entry deployed
Exceptions
ZipException
IOException
ZipEntry CASUAL.archiving.Unzip.getEntry ( Object  entry)

Takes in an ZipEntry as an object and returns the ZipEntry for the Object.

Parameters
entrythe ZipEntry Object
Returns
the ZipEntry
See Also
ZipEntry
ZipEntry CASUAL.archiving.Unzip.getEntry ( Object  entry)

Takes in an ZipEntry as an object and returns the ZipEntry for the Object.

Parameters
entrythe ZipEntry Object
Returns
the ZipEntry
See Also
ZipEntry
String CASUAL.archiving.Unzip.getEntryName ( Object  entry)

Takes in a ZipEntry as an object and returns the string of the corresponding file name for the entry.

Parameters
entrythe ZipEntry Object
Returns
name of the file contained in the
See Also
ZipEntry::getName()
String CASUAL.archiving.Unzip.getEntryName ( Object  entry)

Takes in a ZipEntry as an object and returns the string of the corresponding file name for the entry.

Parameters
entrythe ZipEntry Object
Returns
name of the file contained in the
See Also
ZipEntry::getName()
static BufferedInputStream CASUAL.archiving.Unzip.streamFileFromZip ( File  zipFile,
Object  entry 
) throws ZipException, IOException
static

Gets a stream of a specified file from a zip.

Static method used to stream a file form a zip that is not an Unzip object.

Parameters
zipFilefile to stream from
entryentry to stream
Returns
stream of file
Exceptions
ZipException
IOException
static BufferedInputStream CASUAL.archiving.Unzip.streamFileFromZip ( File  zipFile,
Object  entry 
) throws ZipException, IOException
static

Gets a stream of a specified file from a zip.

Static method used to stream a file form a zip that is not an Unzip object.

Parameters
zipFilefile to stream from
entryentry to stream
Returns
stream of file
Exceptions
ZipException
IOException
BufferedInputStream CASUAL.archiving.Unzip.streamFileFromZip ( Object  entry) throws ZipException, IOException

Retrieves a BufferedInputStream for a specific zip entry in a file.

Parameters
entryZipEntry that is to be pulled from ZipFile to Stream.
Returns
BufferedInputStream of the s pecified ZipEntry.
Exceptions
ZipException
IOException
See Also
ZipEntry
ZipFile
BufferedInputStream
BufferedInputStream CASUAL.archiving.Unzip.streamFileFromZip ( Object  entry) throws ZipException, IOException

Retrieves a BufferedInputStream for a specific zip entry in a file.

Parameters
entryZipEntry that is to be pulled from ZipFile to Stream.
Returns
BufferedInputStream of the s pecified ZipEntry.
Exceptions
ZipException
IOException
See Also
ZipEntry
ZipFile
BufferedInputStream
File [] CASUAL.archiving.Unzip.unzipFile ( String  outputFolder) throws ZipException, IOException

Unzips the ZipFile that was specified in the constructor of the class. Creates folder if necessary

Parameters
outputFolderfolder to be unzipped to
Returns
array of files unzipped
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
CASUAL.archiving.Unzip::Unzip(File)
File [] CASUAL.archiving.Unzip.unzipFile ( String  outputFolder) throws ZipException, IOException

Unzips the ZipFile that was specified in the constructor of the class. Creates folder if necessary

Parameters
outputFolderfolder to be unzipped to
Returns
array of files unzipped
Exceptions
ZipExceptioncorrupted
IOExceptionpermissions
See Also
CASUAL.archiving.Unzip::Unzip(File)
static ArrayList<File> CASUAL.archiving.Unzip.unZipInputStream ( CASUALSessionData  sd,
InputStream  zStream,
String  outputFolder 
) throws FileNotFoundException, IOException
static

Unzips an InputStream.

Takes in an InputStream, converts it to a ZipInputStream, and then iterates through all of the ZipEntries, writing each one of them to a file with the name provided by the ZipEntry.

Parameters
sdSessionData for this run
zStreaminput stream to unzip
outputFolderoutput folder to unzip to
Returns
array list of files extract
Exceptions
FileNotFoundExceptionoutput missing or permissions
IOExceptionpermissions
See Also
InputStream
ZipEntry
ZipInputStream
ZipFile
static ArrayList<File> CASUAL.archiving.Unzip.unZipInputStream ( CASUALSessionData  sd,
InputStream  zStream,
String  outputFolder 
) throws FileNotFoundException, IOException
static

Unzips an InputStream.

Takes in an InputStream, converts it to a ZipInputStream, and then iterates through all of the ZipEntries, writing each one of them to a file with the name provided by the ZipEntry.

Parameters
sdSessionData for this run
zStreaminput stream to unzip
outputFolderoutput folder to unzip to
Returns
array list of files extract
Exceptions
FileNotFoundExceptionoutput missing or permissions
IOExceptionpermissions
See Also
InputStream
ZipEntry
ZipInputStream
ZipFile
static void CASUAL.archiving.Unzip.unZipResource ( CASUALSessionData  sd,
String  zipResource,
String  outputFolder 
) throws FileNotFoundException, IOException
static

Unzips a resource.

Within a java package there is a folder called resources, used to store things such as internalized strings, sounds, and other important static files. This function takes in the name of the resource and then outputs it into the output folder.

Parameters
sdSessionData for this run
zipResourcename of the java resource to be unzipped
outputFolderfolder to unzip to
Exceptions
FileNotFoundExceptionoutput folder missing or permissions
IOExceptionpermissions
See Also
java.lang.Class::getResource(String)
static void CASUAL.archiving.Unzip.unZipResource ( CASUALSessionData  sd,
String  zipResource,
String  outputFolder 
) throws FileNotFoundException, IOException
static

Unzips a resource.

Within a java package there is a folder called resources, used to store things such as internalized strings, sounds, and other important static files. This function takes in the name of the resource and then outputs it into the output folder.

Parameters
sdSessionData for this run
zipResourcename of the java resource to be unzipped
outputFolderfolder to unzip to
Exceptions
FileNotFoundExceptionoutput folder missing or permissions
IOExceptionpermissions
See Also
java.lang.Class::getResource(String)

Member Data Documentation

Enumeration<?extends ZipEntry > CASUAL.archiving.Unzip.zipFileEntries

Unzip provides a set of methods which work to unzip files.


The documentation for this class was generated from the following file: