Class ResourcesHelper


  • public class ResourcesHelper
    extends Object
    Some useful methods to locate resources. Created on 08/04/16.
    Since:
    3.0
    Author:
    Tony Chemit - chemit@codelutin.com
    • Field Detail

      • verbose

        protected final boolean verbose
    • Constructor Detail

      • ResourcesHelper

        public ResourcesHelper​(ClassLoader classLoader,
                               boolean verbose)
    • Method Detail

      • isJavaFileInClassPath

        public boolean isJavaFileInClassPath​(String fqn)
        Checks if the given fully qualified name java file is in class-path and log a message that fqn will not generated if found.
        Parameters:
        fqn - fully qualified name to test
        Returns:
        true if java file was found in class-path, false otherwise.
      • isFullyQualifiedNameInClassPath

        public boolean isFullyQualifiedNameInClassPath​(String fqn,
                                                       String extension)
        Checks if the given fully qualified name (path separated by pathSeparator and optionaly suffixed by extension) is in class-path and log a message that fqn will not generated if found.
        Parameters:
        extension - file extension
        fqn - fully qualified name to test
        Returns:
        true if resource was found in class-path, false otherwise.
      • isInClassPath

        public boolean isInClassPath​(String fqn,
                                     String pathSeparator,
                                     String extension)
        Checks if the given fully qualified name (path separated by pathSeparator and optionaly suffixed by extension) is in class-path and log a message that fqn will not generated if found.
        Parameters:
        extension - file extension
        fqn - fully qualified name to test
        Returns:
        true if resource was found in class-path, false otherwise.
      • getFileInClassPath

        protected URL getFileInClassPath​(String fqn,
                                         String pathSeparator,
                                         String extension)