Modifier and Type | Field and Description |
---|---|
private java.lang.ClassLoader |
classLoader |
private java.lang.String |
resourceName |
Constructor and Description |
---|
ClassLoaderAsset(java.lang.String resourceName)
Load a named resource using the current threads context classloader.
|
ClassLoaderAsset(java.lang.String resourceName,
java.lang.ClassLoader classLoader)
Load a named resource using the given classloader.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSource()
Returns the loaded resource.
|
java.io.InputStream |
openStream()
Opens up the given resource as a stream.
|
private java.lang.String resourceName
private java.lang.ClassLoader classLoader
public ClassLoaderAsset(java.lang.String resourceName)
resourceName
- The name of the resource to loadjava.lang.IllegalArgumentException
- resourceName can not be nulljava.lang.IllegalArgumentException
- resourceName must be found in given classloaderpublic ClassLoaderAsset(java.lang.String resourceName, java.lang.ClassLoader classLoader)
resourceName
- The name of the resource to loadclassLoader
- The ClassLoader to usejava.lang.IllegalArgumentException
- resourceName can not be nulljava.lang.IllegalArgumentException
- classloader can not be nulljava.lang.IllegalArgumentException
- resourceName must be found in given classloaderpublic java.lang.String getSource()
public java.io.InputStream openStream()
openStream
in interface Asset
InputStream
for each call