public final class JarUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
URL_SCHEME_PATTERN
Check if a path has a URL scheme at the beginning.
|
| Modifier and Type | Method and Description | ||
|---|---|---|---|
static java.lang.String |
classfilePathToClassName(java.lang.String classfilePath)
Convert a classfile path to the corresponding class name.
|
||
static java.lang.String |
classNameToClassfilePath(java.lang.String className)
Convert a class name to the corresponding classfile path.
|
||
static java.lang.String |
derivedAutomaticModuleName(java.lang.String jarPath)
Derive automatic module name from jar name, using
static java.lang.StringleafName(java.lang.String path)
Returns the leafname of a path, after first stripping off everything after the first '!'
| ||
static java.lang.String |
pathElementsToPathStr(java.lang.Iterable<?> pathElts)
Get a set of path elements as a string, from an array of objects (e.g. of String, File or URL type, whose
toString() method will be called to get the path component), and return the path as a single string
delineated with the standard path separator character.
|
||
static java.lang.String |
pathElementsToPathStr(java.lang.Object... pathElts)
Get a set of path elements as a string, from an array of objects (e.g. of String, File or URL type, whose
toString() method will be called to get the path component), and return the path as a single string
delineated with the standard path separator character.
|
||
static java.lang.String[] |
smartPathSplit(java.lang.String pathStr,
char separatorChar,
ScanSpec scanSpec)
Split a path on the given separator char.
|
||
static java.lang.String[] |
smartPathSplit(java.lang.String pathStr,
ScanSpec scanSpec)
Split a path on File.pathSeparator (':' on Linux, ';' on Windows), but also allow for the use of URLs with
protocol specifiers, e.g.
|
public static final java.util.regex.Pattern URL_SCHEME_PATTERN
public static java.lang.String[] smartPathSplit(java.lang.String pathStr,
ScanSpec scanSpec)
pathStr - The path to split.scanSpec - the scan specpublic static java.lang.String[] smartPathSplit(java.lang.String pathStr,
char separatorChar,
ScanSpec scanSpec)
pathStr - The path to split.separatorChar - The separator char to use.scanSpec - the scan specpublic static java.lang.String pathElementsToPathStr(java.lang.Object... pathElts)
pathElts - The path elements.public static java.lang.String pathElementsToPathStr(java.lang.Iterable<?> pathElts)
pathElts - The path elements.public static java.lang.String leafName(java.lang.String path)
path - A file path.public static java.lang.String classfilePathToClassName(java.lang.String classfilePath)
classfilePath - the classfile pathpublic static java.lang.String classNameToClassfilePath(java.lang.String className)
className - the class namepublic static java.lang.String derivedAutomaticModuleName(java.lang.String jarPath)
jarPath - The jar path.