Class AssetUtil
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.asset.AssetUtil
-
public final class AssetUtil extends java.lang.Object
AssetUtil Util class to help extract name/paths from Assets.- Version:
- $Revision: $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DELIMITER_CLASS_NAME_PATH
The delimiter used for classes.static java.lang.String
DELIMITER_RESOURCE_PATH
The delimiter used for classes represented in resource form.private static java.lang.String
EXTENSION_CLASS
Extension applied to .class files
-
Constructor Summary
Constructors Modifier Constructor Description private
AssetUtil()
Private constructor for util class, should never be created.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getClassLoaderResourceName(java.lang.Package resourcePackage, java.lang.String resourceName)
Helper to convert from java package name to class loader package name
ie: javax.test + my.txt = javax/test/ + my.txtstatic ArchivePath
getFullPathForClassResource(java.lang.Class<?> clazz)
Helper to extract a ClassResources full path.static ArchivePath
getFullPathForClassResource(java.lang.String className)
Helper to extract a ClassResources full path.static java.lang.String
getNameForClassloaderResource(java.lang.String resourceName)
Helper to extract a ClassloaderResources name.static ArchivePath
getPathForClassloaderResource(java.lang.String resourceName)
Helper to extract a ClassloaderResources path information.
-
-
-
Field Detail
-
DELIMITER_CLASS_NAME_PATH
public static final java.lang.String DELIMITER_CLASS_NAME_PATH
The delimiter used for classes.- See Also:
- Constant Field Values
-
DELIMITER_RESOURCE_PATH
public static final java.lang.String DELIMITER_RESOURCE_PATH
The delimiter used for classes represented in resource form.- See Also:
- Constant Field Values
-
EXTENSION_CLASS
private static final java.lang.String EXTENSION_CLASS
Extension applied to .class files- See Also:
- Constant Field Values
-
-
Method Detail
-
getPathForClassloaderResource
public static ArchivePath getPathForClassloaderResource(java.lang.String resourceName)
Helper to extract a ClassloaderResources path information.
ie: /user/test/file.properties = /user/test/- Parameters:
resourceName
- The name of the resource- Returns:
- A Path representation of the give resource
-
getClassLoaderResourceName
public static java.lang.String getClassLoaderResourceName(java.lang.Package resourcePackage, java.lang.String resourceName)
Helper to convert from java package name to class loader package name
ie: javax.test + my.txt = javax/test/ + my.txt- Parameters:
resourcePackage
- The base packageresourceName
- The resource inside the package.- Returns:
ClassLoader
resource location
-
getNameForClassloaderResource
public static java.lang.String getNameForClassloaderResource(java.lang.String resourceName)
Helper to extract a ClassloaderResources name.
ie: /user/test/file.properties = file.properties- Parameters:
resourceName
- The name of the resource- Returns:
- The name of the given resource
-
getFullPathForClassResource
public static ArchivePath getFullPathForClassResource(java.lang.Class<?> clazz)
Helper to extract a ClassResources full path.
ie: package.MyClass = package/MyClass.class- Parameters:
clazz
-- Returns:
-
getFullPathForClassResource
public static ArchivePath getFullPathForClassResource(java.lang.String className)
Helper to extract a ClassResources full path.
ie: package.MyClass = package/MyClass.class- Parameters:
className
-- Returns:
-
-