|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.util.file.JarUtils
A utility class for dealing with Jar files.
Method Summary | |
static URL |
extractNestedJar(URL jarURL,
File dest)
Given a URL check if its a jar url(jar: |
static void |
jar(OutputStream out,
File src)
This function will create a Jar archive containing the src file/directory. |
static void |
jar(OutputStream out,
File[] src)
This function will create a Jar archive containing the src file/directory. |
static void |
jar(OutputStream out,
File[] src,
FileFilter filter)
This function will create a Jar archive containing the src file/directory. |
static void |
jar(OutputStream out,
File[] src,
FileFilter filter,
String prefix,
Manifest man)
This function will create a Jar archive containing the src file/directory. |
static void |
main(String[] args)
A simple jar-like tool used for testing. |
static void |
unjar(InputStream in,
File dest)
Dump the contents of a JarArchive to the dpecified destination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void jar(OutputStream out, File src) throws IOException
This function will create a Jar archive containing the src file/directory. The archive will be written to the specified OutputStream.
This is a shortcut for
jar(out, new File[] { src }, null, null, null);
out
- The output stream to which the generated Jar archive is
written.src
- The file or directory to jar up. Directories will be
processed recursively.
IOException
public static void jar(OutputStream out, File[] src) throws IOException
This function will create a Jar archive containing the src file/directory. The archive will be written to the specified OutputStream.
This is a shortcut for
jar(out, src, null, null, null);
out
- The output stream to which the generated Jar archive is
written.src
- The file or directory to jar up. Directories will be
processed recursively.
IOException
public static void jar(OutputStream out, File[] src, FileFilter filter) throws IOException
This function will create a Jar archive containing the src file/directory. The archive will be written to the specified OutputStream. Directories are processed recursively, applying the specified filter if it exists.
This is a shortcut for
jar(out, src, filter, null, null);
out
- The output stream to which the generated Jar archive is
written.src
- The file or directory to jar up. Directories will be
processed recursively.filter
- The filter to use while processing directories. Only
those files matching will be included in the jar archive. If
null, then all files are included.
IOException
public static void jar(OutputStream out, File[] src, FileFilter filter, String prefix, Manifest man) throws IOException
This function will create a Jar archive containing the src file/directory. The archive will be written to the specified OutputStream. Directories are processed recursively, applying the specified filter if it exists.
out
- The output stream to which the generated Jar archive is
written.src
- The file or directory to jar up. Directories will be
processed recursively.filter
- The filter to use while processing directories. Only
those files matching will be included in the jar archive. If
null, then all files are included.prefix
- The name of an arbitrary directory that will precede all
entries in the jar archive. If null, then no prefix will be
used.man
- The manifest to use for the Jar archive. If null, then no
manifest will be included.
IOException
public static void unjar(InputStream in, File dest) throws IOException
IOException
public static URL extractNestedJar(URL jarURL, File dest) throws IOException
jarURL
- the URL to validate and extract the referenced entry if its
a jar protocol URLdest
- the directory into which the nested jar will be extracted.
IOException
public static void main(String[] args) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |