Class ClasspathUtils
- java.lang.Object
-
- io.github.fastclasspathscanner.utils.ClasspathUtils
-
public class ClasspathUtils extends Object
Classpath utility functions.
-
-
Constructor Summary
Constructors Constructor Description ClasspathUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canRead(File file)
static URL
getClasspathResourceURL(File classpathElt, String relativePath)
Can be used to get the URL of a classpath resource whose classpath element and relative path has been passed into a MatchProcessor.
-
-
-
Method Detail
-
getClasspathResourceURL
public static URL getClasspathResourceURL(File classpathElt, String relativePath)
Can be used to get the URL of a classpath resource whose classpath element and relative path has been passed into a MatchProcessor.- Parameters:
classpathElt
- The classpath element (a directory or jarfile), as a File object.relativePath
- The relative path within the classpath element, with '/' as the path delimiter character, and without an initial or final delimiter character.- Returns:
- The URL, in the form "file:/classpath/elt/path/followed/by/relative/path" or "jar:file:/classpath/elt/path.jar!/followed/by/relative/path".
-
canRead
public static boolean canRead(File file)
- Parameters:
file
- A .- Returns:
- true if a file exists and can be read.
-
-