public class ClassLoaderAsset extends Object implements Asset
Asset
backed by a resource located in the Classloader.Constructor and Description |
---|
ClassLoaderAsset(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.
|
Modifier and Type | Method and Description |
---|---|
String |
getSource()
Returns the loaded resource.
|
InputStream |
openStream()
Opens up the given resource as a stream.
|
public ClassLoaderAsset(String resourceName)
resourceName
- The name of the resource to loadIllegalArgumentException
- resourceName can not be nullIllegalArgumentException
- resourceName must be found in given classloaderpublic ClassLoaderAsset(String resourceName, ClassLoader classLoader)
resourceName
- The name of the resource to loadclassLoader
- The ClassLoader to useIllegalArgumentException
- resourceName can not be nullIllegalArgumentException
- classloader can not be nullIllegalArgumentException
- resourceName must be found in given classloaderpublic String getSource()
public InputStream openStream()
openStream
in interface Asset
InputStream
for each callCopyright © 2016 JBoss by Red Hat. All rights reserved.