public class JarUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_DOT_EXTENSION |
static java.lang.String |
FILE_EXTENSION |
Constructor and Description |
---|
JarUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
getAllFiles(java.lang.String fileName,
boolean includeFolderEntry,
boolean includeHidden)
Returns all files contained in the specified JAR file.
|
static void |
getAllFiles(java.lang.String fileName,
boolean includeFolderEntry,
boolean includeHidden,
java.util.List<java.lang.String> result)
Returns all files contained in the specified JAR file.
|
static java.util.jar.JarEntry |
getJarClassEntry(java.util.jar.JarFile file,
java.lang.String className)
Find a class entry in the specified JAR file
|
static java.util.jar.JarEntry |
getJarEntry(java.util.jar.JarFile file,
java.lang.String entryName)
Find the specified entry in the specified JAR file
|
static java.util.jar.JarFile |
getJarFile(java.lang.String path)
Return a JAR File from the specified path
|
static java.net.URL |
getJarURL(java.lang.String path)
Return a JAR URL from the specified path
|
static java.net.URL |
getJarURL(java.lang.String jarPath,
java.util.jar.JarEntry entry)
Return a JAR URL from the specified JAR path and JAR entry
|
static boolean |
isJarURL(java.lang.String path)
Return true if specified URL is a JAR url
|
public static final java.lang.String FILE_EXTENSION
public static final java.lang.String FILE_DOT_EXTENSION
public JarUtil()
public static boolean isJarURL(java.lang.String path)
public static java.net.URL getJarURL(java.lang.String path)
public static java.net.URL getJarURL(java.lang.String jarPath, java.util.jar.JarEntry entry)
public static java.util.jar.JarFile getJarFile(java.lang.String path)
public static java.util.jar.JarEntry getJarClassEntry(java.util.jar.JarFile file, java.lang.String className)
public static java.util.jar.JarEntry getJarEntry(java.util.jar.JarFile file, java.lang.String entryName)
public static void getAllFiles(java.lang.String fileName, boolean includeFolderEntry, boolean includeHidden, java.util.List<java.lang.String> result)
includeFolderEntry
- if true
all folder entry are also includedincludeHidden
- if true
all hidden files (starting by '.' character) are also includedpublic static java.util.List<java.lang.String> getAllFiles(java.lang.String fileName, boolean includeFolderEntry, boolean includeHidden)
includeFolderEntry
- if true
all folder entry are also includedincludeHidden
- if true
all hidden files (starting by '.' character) are also included