public class ClassPathUtils
extends java.lang.Object
The methods of this class do not allow null
inputs.
Constructor and Description |
---|
ClassPathUtils()
ClassPathUtils instances should NOT be constructed in
standard programming. |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
toFullyQualifiedName(java.lang.Class<?> context,
java.lang.String resourceName)
Returns the fully qualified name for the resource with name
resourceName relative to the given context. |
static java.lang.String |
toFullyQualifiedName(java.lang.Package context,
java.lang.String resourceName)
Returns the fully qualified name for the resource with name
resourceName relative to the given context. |
static java.lang.String |
toFullyQualifiedPath(java.lang.Class<?> context,
java.lang.String resourceName)
Returns the fully qualified path for the resource with name
resourceName relative to the given context. |
static java.lang.String |
toFullyQualifiedPath(java.lang.Package context,
java.lang.String resourceName)
Returns the fully qualified path for the resource with name
resourceName relative to the given context. |
public ClassPathUtils()
ClassPathUtils
instances should NOT be constructed in
standard programming. Instead, the class should be used as
ClassPathUtils.toFullyQualifiedName(MyClass.class, "MyClass.properties");
.
This constructor is public to permit tools that require a JavaBean instance to operate.
public static java.lang.String toFullyQualifiedName(java.lang.Class<?> context, java.lang.String resourceName)
resourceName
relative to the given context.
Note that this method does not check whether the resource actually exists. It only constructs the name. Null inputs are not allowed.
ClassPathUtils.toFullyQualifiedName(StringUtils.class, "StringUtils.properties") = "org.apache.commons.lang3.StringUtils.properties"
context
- The context for constructing the name.resourceName
- the resource name to construct the fully qualified name for.resourceName
.java.lang.NullPointerException
- if either context
or resourceName
is null.public static java.lang.String toFullyQualifiedName(java.lang.Package context, java.lang.String resourceName)
resourceName
relative to the given context.
Note that this method does not check whether the resource actually exists. It only constructs the name. Null inputs are not allowed.
ClassPathUtils.toFullyQualifiedName(StringUtils.class.getPackage(), "StringUtils.properties") = "org.apache.commons.lang3.StringUtils.properties"
context
- The context for constructing the name.resourceName
- the resource name to construct the fully qualified name for.resourceName
.java.lang.NullPointerException
- if either context
or resourceName
is null.public static java.lang.String toFullyQualifiedPath(java.lang.Class<?> context, java.lang.String resourceName)
resourceName
relative to the given context.
Note that this method does not check whether the resource actually exists. It only constructs the path. Null inputs are not allowed.
ClassPathUtils.toFullyQualifiedPath(StringUtils.class, "StringUtils.properties") = "org/apache/commons/lang3/StringUtils.properties"
context
- The context for constructing the path.resourceName
- the resource name to construct the fully qualified path for.resourceName
.java.lang.NullPointerException
- if either context
or resourceName
is null.public static java.lang.String toFullyQualifiedPath(java.lang.Package context, java.lang.String resourceName)
resourceName
relative to the given context.
Note that this method does not check whether the resource actually exists. It only constructs the path. Null inputs are not allowed.
ClassPathUtils.toFullyQualifiedPath(StringUtils.class.getPackage(), "StringUtils.properties") = "org/apache/commons/lang3/StringUtils.properties"
context
- The context for constructing the path.resourceName
- the resource name to construct the fully qualified path for.resourceName
.java.lang.NullPointerException
- if either context
or resourceName
is null.Copyright © 2010 - 2020 Adobe. All Rights Reserved