Package org.nuiton.eugene
Class ResourcesHelper
- java.lang.Object
-
- org.nuiton.eugene.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 Summary
Fields Modifier and Type Field Description protected ClassLoader
classLoader
protected boolean
verbose
-
Constructor Summary
Constructors Constructor Description ResourcesHelper(ClassLoader classLoader, boolean verbose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected URL
getFileInClassPath(String fqn, String pathSeparator, String extension)
boolean
isFullyQualifiedNameInClassPath(String fqn, String extension)
Checks if the given fully qualified name (path separated bypathSeparator
and optionaly suffixed byextension
) is in class-path and log a message that fqn will not generated if found.boolean
isInClassPath(String fqn, String pathSeparator, String extension)
Checks if the given fully qualified name (path separated bypathSeparator
and optionaly suffixed byextension
) is in class-path and log a message that fqn will not generated if found.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.
-
-
-
Field Detail
-
classLoader
protected final ClassLoader classLoader
-
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 bypathSeparator
and optionaly suffixed byextension
) is in class-path and log a message that fqn will not generated if found.- Parameters:
extension
- file extensionfqn
- 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 bypathSeparator
and optionaly suffixed byextension
) is in class-path and log a message that fqn will not generated if found.- Parameters:
extension
- file extensionfqn
- fully qualified name to test- Returns:
true
if resource was found in class-path,false
otherwise.
-
-