Package com.ardor3d.util.resource
Class ResourceLocatorTool
java.lang.Object
com.ardor3d.util.resource.ResourceLocatorTool
Manager class for locator utility classes used to find various assets. (XXX: Needs more documentation)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addResourceLocator
(String resourceType, ResourceLocator locator) static URL
getClassPathResource
(Class<?> clazz, String name) Locate a resource using various classloaders.static InputStream
getClassPathResourceAsStream
(Class<?> clazz, String name) Locate a resource using various classloaders and open a stream to it.getClassPathResources
(Class<?> clazz, String name) Locate all instances of a resource using various classloaders.static ResourceSource
locateResource
(String resourceType, String resourceName) static boolean
removeResourceLocator
(String resourceType, ResourceLocator locator)
-
Field Details
-
TYPE_TEXTURE
- See Also:
-
TYPE_MODEL
- See Also:
-
TYPE_PARTICLE
- See Also:
-
TYPE_AUDIO
- See Also:
-
TYPE_SHADER
- See Also:
-
-
Constructor Details
-
ResourceLocatorTool
public ResourceLocatorTool()
-
-
Method Details
-
locateResource
-
addResourceLocator
-
removeResourceLocator
-
getClassPathResource
Locate a resource using various classloaders.- First it tries the Thread.currentThread().getContextClassLoader().
- Then it tries the ClassLoader.getSystemClassLoader() (if not same as context class loader).
- Finally it tries the clazz.getClassLoader()
- Parameters:
clazz
- a class to use as a local reference.name
- the name and path of the resource.- Returns:
- the URL of the resource, or null if none found.
-
getClassPathResourceAsStream
Locate a resource using various classloaders and open a stream to it.- Parameters:
clazz
- a class to use as a local reference.name
- the name and path of the resource.- Returns:
- the input stream if resource is found, or null if not.
-
getClassPathResources
Locate all instances of a resource using various classloaders.- Parameters:
clazz
- a class to use as a local reference.name
- the name and path of the resource.- Returns:
- a set containing the located URLs of the named resource.
-