| |
|
| java.lang.Object org.tp23.antinstaller.selfextract.SelfExtractor
All known Subclasses: org.tp23.antinstaller.selfextract.NonExtractor,
SelfExtractor | public class SelfExtractor (Code) | | Finds a file reference to the Jar that loads this class and then extracts that Jar
to a temporary directory
author: Paul Hinds version: $Id: SelfExtractor.java,v 1.10 2007/01/28 08:44:40 teknopaul Exp $ |
Constructor Summary | |
public | SelfExtractor() Constructor for the SelfExtractor object. | public | SelfExtractor(int newBufferSize) Constructor for the SelfExtractor object that sets the buffersize in use. |
CONFIG_RESOURCE | final public static String CONFIG_RESOURCE(Code) | | |
SelfExtractor | public SelfExtractor()(Code) | | Constructor for the SelfExtractor object. Directly after constructing
an instance the init() method should be called unless subclassing
|
SelfExtractor | public SelfExtractor(int newBufferSize)(Code) | | Constructor for the SelfExtractor object that sets the buffersize in use.
The write buffer is the same size as the write buffer size because the read buffer reads
decompressed bytes
Parameters: newBufferSize - the size of the read buffer |
deleteRecursive | public static int deleteRecursive(File directory)(Code) | | |
extract | public ArrayList extract(boolean vebose, boolean isX) throws FileNotFoundException, IOException(Code) | | Opens up the zip and extracts the files to the temp dir.
Parameters: vebose - if true Prints out a list of the zips contents on to System.out an ArrayList of java.io.File objects thatwill be as per the path in the zip with the root being the temp dir exception: FileNotFoundException - exception: IOException - |
getArchiveFile | public File getArchiveFile()(Code) | | Gets the set in the ZipExtractor
The archiveFile value |
getEnclosingJar | public static File getEnclosingJar(Object reference)(Code) | | returns the Jar that the reference object was loaded from. If it was not
loaded from a jar this methods behaviour is undefined
Parameters: reference - A java.io.File reference to the Jar or null |
getExtractDir | public File getExtractDir()(Code) | | Gets the Directory into which the files will be extracted that
is currently set in the ZipExtractor object
The extract directory value |
getList | public ArrayList getList(boolean vebose) throws FileNotFoundException, IOException(Code) | | Opens up the zip and gets a list of the files in it. If the zip file
or the temp file have not been set NullPointerExceptions will get thrown
Parameters: vebose - if true Prints out a list of the zipscontents on to the command line an ArrayList of String objects that willbe as per the path in the zip exception: FileNotFoundException - Description of Exception exception: IOException - Description of Exception |
init | public void init()(Code) | | This has been moved from the default constructor to facilitate subclassing
true if the lookAndFeel worked |
isOverwrite | public boolean isOverwrite()(Code) | | Gets the set in the ZipExtractor
The archiveFile value |
main | public static void main(String[] args)(Code) | | Run method to use from the command line. This is fired via an entry in the
MANIFEST.MF in the Jar
Parameters: args - The command line arguments |
makeTempDir | protected File makeTempDir()(Code) | | Creates a new empty temporary directory for the file extraction
|
printXorTextWarning | protected static void printXorTextWarning(String warning)(Code) | | |
setArchiveFile | public void setArchiveFile(File newArchiveFile)(Code) | | changes the archive to be extracted
Parameters: newArchiveFile - The new archiveFile value |
setExtractDir | public void setExtractDir(File newExtractDir)(Code) | | Sets the Directory into which the file will be extracted
Parameters: newExtractDir - The new extract directory |
setOverwrite | public void setOverwrite(boolean overwrite)(Code) | | Gets the Directory into which the files will be extracted that
is currently set in the ZipExtractor object
The extract directory value |
testX | protected static void testX()(Code) | | This tests for the existence of a graphics environment and sets an
internal flag so the test does not have to be repeated, it may be expensive.
Prior to running this method the isGraphicsEnv() method will be invalid.
|
|
|
|