|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.util.ArchiveUtil
public final class ArchiveUtil
Util for extracting *.jar, *.war and *.zip archives.
Field Summary | |
---|---|
static String[] |
SUPPORTED_FILES
The suffixes of the files to support. |
Constructor Summary | |
---|---|
ArchiveUtil()
|
Method Summary | |
---|---|
static boolean |
extract(File archive,
File targetDir)
|
static boolean |
extract(File archive,
File targetDir,
boolean deleteOnExit)
|
static boolean |
extract(URL archive,
File targetDir)
|
static boolean |
extract(URL archive,
File targetDir,
boolean deleteOnExit)
Extracts the file archive to the target dir targetDir and deletes the
files extracted upon jvm exit if the flag deleteOnExit is true. |
static File |
getTempDir()
Gets the temp dir (the sys property "java.io.tmpdir" if not overridden via setTempDir(File) ). |
static boolean |
isSupported(String resource)
Returns true if the given resource is either a zip, jar or war file. |
static void |
setTempDir(File tempDir)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] SUPPORTED_FILES
Constructor Detail |
---|
public ArchiveUtil()
Method Detail |
---|
public static void setTempDir(File tempDir)
public static File getTempDir()
setTempDir(File)
).
public static boolean isSupported(String resource)
resource
is either a zip, jar or war file.
public static boolean extract(File archive, File targetDir) throws IOException
IOException
public static boolean extract(File archive, File targetDir, boolean deleteOnExit) throws IOException
IOException
public static boolean extract(URL archive, File targetDir) throws IOException
IOException
public static boolean extract(URL archive, File targetDir, boolean deleteOnExit) throws IOException
archive
to the target dir targetDir
and deletes the
files extracted upon jvm exit if the flag deleteOnExit
is true.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |