Class ClassLoaderAsset
java.lang.Object
org.jboss.shrinkwrap.api.asset.ClassLoaderAsset
- All Implemented Interfaces:
Asset
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClassLoaderAsset(String resourceName) Load a named resource using the current threads context classloader.ClassLoaderAsset(String resourceName, ClassLoader classLoader) Load a named resource using the given classloader. -
Method Summary
Modifier and TypeMethodDescriptionReturns the loaded resource.Opens up the given resource as a stream.
-
Field Details
-
resourceName
-
classLoader
-
-
Constructor Details
-
ClassLoaderAsset
Load a named resource using the current threads context classloader.- Parameters:
resourceName- The name of the resource to load- Throws:
IllegalArgumentException- resourceName can not be nullIllegalArgumentException- resourceName must be found in given classloader
-
ClassLoaderAsset
Load a named resource using the given classloader.- Parameters:
resourceName- The name of the resource to loadclassLoader- The ClassLoader to use- Throws:
IllegalArgumentException- resourceName can not be nullIllegalArgumentException- classloader can not be nullIllegalArgumentException- resourceName must be found in given classloader
-
-
Method Details
-
getSource
Returns the loaded resource. -
openStream
Opens up the given resource as a stream.- Specified by:
openStreamin interfaceAsset- Returns:
- A new open
InputStreamfor each call
-