Class ClasspathUtils


  • public class ClasspathUtils
    extends Object
    • Constructor Detail

      • ClasspathUtils

        public ClasspathUtils()
    • 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)
        Return true if a file exists and can be read.