public class JarUtils extends Object
Constructor and Description |
---|
JarUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
countBytesBeforePKMarker(File zipfile)
Count the number of bytes before the characters "PK" in a zipfile.
|
static String |
getRtJarPath()
Get the path of rt.jar
|
static boolean |
isJREJar(String filePath,
LogNode log)
Determine whether a given jarfile is in a JRE system directory (jre, jre/lib, jre/lib/ext, etc.).
|
static String |
leafName(String path)
Returns the leafname of a path, after first stripping off everything after the first '!', if present.
|
static void |
logJavaInfo(LogNode log)
Log the Java version and the JRE paths that were found.
|
static String |
pathElementsToPathStr(Iterable<?> pathElts)
Get a set of path elements as a string, from an array of objects (e.g.
|
static String |
pathElementsToPathStr(Object... pathElts)
Get a set of path elements as a string, from an array of objects (e.g.
|
static String[] |
smartPathSplit(String pathStr)
Split a path on File.pathSeparator (':' on Linux, ';' on Windows), but also allow for the use of URLs with
protocol specifiers, e.g.
|
static void |
stripSFXHeader(File srcZipfile,
long sfxHeaderBytes,
File destZipfile)
Strip the self-extracting archive header from the beginning of a zipfile.
|
public static String[] smartPathSplit(String pathStr)
public static String pathElementsToPathStr(Object... pathElts)
public static String pathElementsToPathStr(Iterable<?> pathElts)
public static String leafName(String path)
public static String getRtJarPath()
public static boolean isJREJar(String filePath, LogNode log)
public static long countBytesBeforePKMarker(File zipfile) throws IOException
IOException
public static void stripSFXHeader(File srcZipfile, long sfxHeaderBytes, File destZipfile) throws IOException
IOException
public static void logJavaInfo(LogNode log)
Copyright © 2018. All rights reserved.