|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.UpdateInstaller.Unzip
public class Unzip
Provides several static utilities for use when unzipping files from an archive.
Constructor Summary | |
---|---|
Unzip()
|
Method Summary | |
---|---|
static boolean |
findFileInsideInnerZip(java.lang.String filename,
java.lang.String zipfile,
java.lang.String innerZipFile)
Looks for a file that is in a zip within the main zip file. |
static java.lang.String |
findMatchingFileSpecInZip(java.lang.String spec,
java.lang.String zipfile)
Tells if a file matching the given regular expression is contained in a zip archive. |
static java.lang.String |
getDefaultExtractionLocation()
Gets the default extraction location. |
static java.io.InputStream |
getInputStreamFromFileInArchive(java.lang.String filename,
java.util.zip.ZipFile zf,
java.lang.String zipfile)
Gets an input stream associated with a file inside a zip archive so it can be subsequently read. |
static boolean |
isFileInArchive(java.lang.String filename,
java.lang.String zipfile)
Tells if a file with the given name is contained in a zip archive. |
static boolean |
isUseCEAlg()
Get the value of the useCEAlg flag |
static void |
listArchive(java.lang.String zipfile)
Lists files in an archive. |
static void |
setDefaultExtractionLocation(java.lang.String loc)
Sets the extraction location. |
static void |
setUseCEAlg(boolean useCEAlg)
Set whether or not to use the CE algorithm |
static java.lang.String[] |
unzipAndReadSingleFile(java.lang.String filename,
java.lang.String zipfile)
Reads a file in a zip archive without unzipping it. |
static java.lang.String[] |
unzipSingleBinaryFile(java.lang.String filename,
java.lang.String zipfile,
boolean isText)
Unzips a file from a specified archive. |
static java.lang.String[] |
unzipSingleBinaryFile(java.lang.String filename,
java.lang.String zipfile,
boolean isText,
java.lang.String target_filename)
Unzips a file from a specified archive with the same name as contained in the archive. |
static void |
unzipToDirectory(java.lang.String filename,
java.lang.String directory,
java.lang.String backupDir)
Unzips an entire zip archive to a given directory and optionally backs up replaced files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Unzip()
Method Detail |
---|
public static void setDefaultExtractionLocation(java.lang.String loc)
loc
- The location to extract filespublic static java.lang.String getDefaultExtractionLocation()
public static void setUseCEAlg(boolean useCEAlg)
useCEAlg
- true or falsepublic static boolean isUseCEAlg()
public static void unzipToDirectory(java.lang.String filename, java.lang.String directory, java.lang.String backupDir)
filename
- Name of the zip archivedirectory
- Destination for extracted files from the archivebackupDir
- Directory to place backed up files or null if no backup should
occurpublic static java.lang.String[] unzipAndReadSingleFile(java.lang.String filename, java.lang.String zipfile)
filename
- Filename inside of the archive to readzipfile
- Name of the zip archive which contains the file to read
public static java.io.InputStream getInputStreamFromFileInArchive(java.lang.String filename, java.util.zip.ZipFile zf, java.lang.String zipfile)
filename
- Filename inside of the archivezipfile
- Name of the zip archive which contains the file
public static boolean isFileInArchive(java.lang.String filename, java.lang.String zipfile)
filename
- Filename to search for in the zip archivezipfile
- Name of the zip archive
public static java.lang.String findMatchingFileSpecInZip(java.lang.String spec, java.lang.String zipfile)
spec
- A regular expression indicating a file to search for in a zip
archivezipfile
- Name of the zip archive
public static java.lang.String[] unzipSingleBinaryFile(java.lang.String filename, java.lang.String zipfile, boolean isText, java.lang.String target_filename)
filename
- Name of the file to extractzipfile
- Name of the zip archiveisText
- Indicates whether or not the file should be treated as text
and read into a buffertarget_filename
- Name of the file this archive should be extracted as.
Normally, this should match the original filename
public static java.lang.String[] unzipSingleBinaryFile(java.lang.String filename, java.lang.String zipfile, boolean isText)
filename
- Name of the file to extractzipfile
- Name of the zip archiveisText
- Indicates whether or not the file should be treated as text
and read into a buffer
public static void listArchive(java.lang.String zipfile)
zipfile
- Name of the zip archivepublic static boolean findFileInsideInnerZip(java.lang.String filename, java.lang.String zipfile, java.lang.String innerZipFile)
filename
- Name of the file to search forzipfile
- Name of the zip archiveinnerZipFile
- Name of the zip within the zip file to check archive
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |