public class JarExtractor extends Object
| Constructor and Description |
|---|
JarExtractor() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
copyRecursively(File src,
File dest)
Copy the specified file or directory to the destination.
|
static boolean |
delete(File dir)
Delete the specified directory, including all of its contents and
subdirectories recursively.
|
static boolean |
deleteDir(File dir)
Delete the specified directory, including all of its contents and
subdirectories recursively.
|
static File |
extract(File file,
File destinationDir)
Extract the jar file into the specifiec destination directory.
|
static File |
extract(File file,
String pathname)
Extract the Jar file into an unpacked directory structure, and
return the absolute pathname to the extracted directory.
|
protected static File |
extract(InputStream input,
File docBase,
String name)
Extract the specified input stream into the specified directory, creating
a file named from the specified relative path.
|
public static final Logger logger
public static File extract(File file, String pathname) throws IOException
file - Jar file to unpackpathname - Context path name for web applicationIllegalArgumentException - if this is not a "jar:" URLIOException - if an input/output error was encountered
during expansionpublic static File extract(File file, File destinationDir) throws IOException
file - jar file to unpackdestinationDir - the directory in which the jar will be unpacked; must not existIOException - if an input/output error was encountered during expansionpublic static boolean copyRecursively(File src, File dest)
src - File object representing the sourcedest - File object representing the destinationpublic static boolean delete(File dir)
dir - File object representing the directory to be deletedpublic static boolean deleteDir(File dir)
dir - File object representing the directory to be deletedprotected static File extract(InputStream input, File docBase, String name) throws IOException
input - InputStream to be copieddocBase - Document base directory into which we are extractingname - Relative pathname of the file to be createdIOException - if an input/output error occursCopyright © 1999–2014 The Apache Software Foundation. All rights reserved.