ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

org.jboss.shrinkwrap.impl.base.asset
Class AssetUtil

java.lang.Object
  extended by org.jboss.shrinkwrap.impl.base.asset.AssetUtil

public final class AssetUtil
extends Object

AssetUtil Util class to help extract name/paths from Assets.

Version:
$Revision: $
Author:
Aslak Knutsen

Field Summary
static String DELIMITER_CLASS_NAME_PATH
          The delimiter used for classes.
static String DELIMITER_RESOURCE_PATH
          The delimiter used for classes represented in resource form.
 
Method Summary
static String getClassLoaderResourceName(Package resourcePackage, String resourceName)
          Helper to convert from java package name to class loader package name

ie: javax.test + my.txt = javax/test/ + my.txt
static ArchivePath getFullPathForClassResource(Class<?> clazz)
          Helper to extract a ClassResources full path.
static ArchivePath getFullPathForClassResource(String className)
          Helper to extract a ClassResources full path.
static String getNameForClassloaderResource(String resourceName)
          Helper to extract a ClassloaderResources name.
static ArchivePath getPathForClassloaderResource(String resourceName)
          Helper to extract a ClassloaderResources path information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER_CLASS_NAME_PATH

public static final String DELIMITER_CLASS_NAME_PATH
The delimiter used for classes.

See Also:
Constant Field Values

DELIMITER_RESOURCE_PATH

public static final String DELIMITER_RESOURCE_PATH
The delimiter used for classes represented in resource form.

See Also:
Constant Field Values
Method Detail

getPathForClassloaderResource

public static ArchivePath getPathForClassloaderResource(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 String getClassLoaderResourceName(Package resourcePackage,
                                                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 package
resourceName - The resource inside the package.
Returns:
ClassLoader resource location

getNameForClassloaderResource

public static String getNameForClassloaderResource(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(Class<?> clazz)
Helper to extract a ClassResources full path.

ie: package.MyClass = package/MyClass.class

Parameters:
clazz -
Returns:

getFullPathForClassResource

public static ArchivePath getFullPathForClassResource(String className)
Helper to extract a ClassResources full path.

ie: package.MyClass = package/MyClass.class

Parameters:
className -
Returns:

ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.