|
|||||||||||
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(String filename,
String zipfile,
String innerZipFile)
Looks for a file that is in a zip within the main zip file. |
static String |
findMatchingFileSpecInZip(String spec,
String zipfile)
Tells if a file matching the given regular expression is contained in a zip archive. |
static String |
getDefaultExtractionLocation()
Gets the default extraction location. |
static InputStream |
getInputStreamFromFileInArchive(String filename,
ZipFile zf,
String zipfile)
Gets an input stream associated with a file inside a zip archive so it can be subsequently read. |
static boolean |
isFileInArchive(String filename,
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(String zipfile)
Lists files in an archive. |
static void |
setDefaultExtractionLocation(String loc)
Sets the extraction location. |
static void |
setUseCEAlg(boolean useCEAlg)
Set whether or not to use the CE algorithm |
static String[] |
unzipAndReadSingleFile(String filename,
String zipfile)
Reads a file in a zip archive without unzipping it. |
static String[] |
unzipSingleBinaryFile(String filename,
String zipfile,
boolean isText)
Unzips a file from a specified archive. |
static String[] |
unzipSingleBinaryFile(String filename,
String zipfile,
boolean isText,
String target_filename)
Unzips a file from a specified archive with the same name as contained in the archive. |
static void |
unzipToDirectory(String filename,
String directory,
String backupDir)
Unzips an entire zip archive to a given directory and optionally backs up replaced files. |
static void |
unzipToDirectory(String filename,
String directory,
String backupDir,
String[] filestoExclude)
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(String loc)
loc
- The location to extract filespublic static String getDefaultExtractionLocation()
public static void setUseCEAlg(boolean useCEAlg)
useCEAlg
- true or falsepublic static boolean isUseCEAlg()
public static void unzipToDirectory(String filename, String directory, 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 void unzipToDirectory(String filename, String directory, String backupDir, String[] filestoExclude)
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
occurfilestoExclude
- List of files which need NOT to be unzipped from zip.public static String[] unzipAndReadSingleFile(String filename, String zipfile)
filename
- Filename inside of the archive to readzipfile
- Name of the zip archive which contains the file to read
public static InputStream getInputStreamFromFileInArchive(String filename, ZipFile zf, String zipfile)
filename
- Filename inside of the archivezipfile
- Name of the zip archive which contains the file
public static boolean isFileInArchive(String filename, String zipfile)
filename
- Filename to search for in the zip archivezipfile
- Name of the zip archive
public static String findMatchingFileSpecInZip(String spec, String zipfile)
spec
- A regular expression indicating a file to search for in a zip
archivezipfile
- Name of the zip archive
public static String[] unzipSingleBinaryFile(String filename, String zipfile, boolean isText, 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 String[] unzipSingleBinaryFile(String filename, 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(String zipfile)
zipfile
- Name of the zip archivepublic static boolean findFileInsideInnerZip(String filename, String zipfile, 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 |