sun.module
Class JamUtils
java.lang.Object
sun.module.JamUtils
public final class JamUtils
- extends Object
- Since:
- 1.7
- Version:
- 1.12, 06/19/07
- Author:
- Stanley M. Ho, Andreas Sterbenz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static final boolean DEBUG
DIRECTORY_FILTER
public static final FileFilter DIRECTORY_FILTER
JAM_JAR_FILTER
public static final FilenameFilter JAM_JAR_FILTER
JAM_FILTER
public static final FilenameFilter JAM_FILTER
JAR_FILTER
public static final FilenameFilter JAR_FILTER
CLASS_FILTER
public static final FilenameFilter CLASS_FILTER
getFile
public static File getFile(URL url)
throws IOException
- Throws:
IOException
readFile
public static byte[] readFile(File file)
throws IOException
- Throws:
IOException
readStream
public static byte[] readStream(InputStream in)
throws IOException
- Throws:
IOException
expandJam
public static void expandJam(File sourceJam,
File destDir)
throws IOException
- Throws:
IOException
unjam
public static void unjam(File sourceJam,
File destDir)
throws IOException
- Extracts all files from the
sourceJam
into destDir
.
Really, it's just "cd $destDir; jar xf $sourceJam".
- Parameters:
sourceJam
- .jam file to extract.destDir
- directory into which files are extracted.
- Throws:
IOException
- if any problem occurs.
storeContentAsFile
public static void storeContentAsFile(InputStream is,
File outputFile)
throws IOException
- Read the content from the input stream and store the content
in the output file.
- Parameters:
is
- Input stream of the content.
- Throws:
IOException
recursiveDelete
public static void recursiveDelete(File dir)
throws IOException
- Recursively delete the given
dir
and all its contents.
- Throws:
IOException
getSuperpackage
public static Superpackage getSuperpackage(byte[] data)
throws ClassFormatError
- Throws:
ClassFormatError