public class ResourceLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
cacheEnabled |
protected static java.util.ArrayList |
extractExtensions |
protected static int |
maxPaths |
protected static java.util.Hashtable |
resources |
protected static java.util.ArrayList |
searchPaths |
protected static java.net.URLClassLoader |
xsetZipLoader |
protected static java.util.Map |
zipLoaders |
Modifier and Type | Method and Description |
---|---|
static void |
addExtractExtension(java.lang.String extension)
Adds an extension to the end of the extractExtensions list.
|
static void |
addSearchPath(java.lang.String base)
Adds a path at the beginning of the searchPaths list.
|
static java.applet.AudioClip |
getAudioClip(java.lang.String path) |
static java.awt.image.BufferedImage |
getBufferedImage(java.lang.String path) |
static javax.swing.ImageIcon |
getIcon(java.lang.String path) |
static java.awt.Image |
getImage(java.lang.String path) |
static Resource |
getResource(java.lang.String name)
Gets a resource specified by name.
|
static Resource |
getResource(java.lang.String name,
boolean searchFiles)
Gets a resource specified by name and Class.
|
static Resource |
getResource(java.lang.String name,
java.lang.Class type)
Gets a resource specified by name and Class.
|
static Resource |
getResource(java.lang.String name,
java.lang.Class type,
boolean searchFiles)
Gets a resource specified by name and Class.
|
static Resource |
getResource(java.lang.String basePath,
java.lang.String name)
Gets a resource specified by base path and name.
|
static Resource |
getResource(java.lang.String basePath,
java.lang.String name,
boolean searchFiles)
Gets a resource specified by base path and name.
|
static Resource |
getResource(java.lang.String basePath,
java.lang.String name,
java.lang.Class type)
Gets a resource specified by base path, name and class.
|
static Resource |
getResource(java.lang.String basePath,
java.lang.String name,
java.lang.Class type,
boolean searchFiles)
Gets a resource specified by base path, name and class.
|
static java.lang.String |
getString(java.lang.String path) |
static boolean |
isCacheEnabled()
Gets the cacheEnabled property.
|
static java.io.InputStream |
openInputStream(java.lang.String path) |
static java.io.Reader |
openReader(java.lang.String path) |
static void |
removeSearchPath(java.lang.String base)
Removes a path from the searchPaths list.
|
static void |
setCacheEnabled(boolean enabled)
Sets the cacheEnabled property.
|
protected static java.util.ArrayList searchPaths
protected static int maxPaths
protected static java.util.Hashtable resources
protected static boolean cacheEnabled
protected static java.util.Map zipLoaders
protected static java.net.URLClassLoader xsetZipLoader
protected static java.util.ArrayList extractExtensions
public static Resource getResource(java.lang.String name)
name
- the file or URL namepublic static Resource getResource(java.lang.String name, boolean searchFiles)
name
- the file or URL namesearchFiles
- true to search filespublic static Resource getResource(java.lang.String name, java.lang.Class type)
name
- the file or URL nametype
- the Class providing default ClassLoader resource loadingpublic static Resource getResource(java.lang.String name, java.lang.Class type, boolean searchFiles)
name
- the file or URL nametype
- the Class providing default ClassLoader resource loadingsearchFiles
- true to search filespublic static Resource getResource(java.lang.String basePath, java.lang.String name)
basePath
- the base pathname
- the file or URL namepublic static Resource getResource(java.lang.String basePath, java.lang.String name, boolean searchFiles)
basePath
- the base pathname
- the file or URL namesearchFiles
- true to search filespublic static Resource getResource(java.lang.String basePath, java.lang.String name, java.lang.Class type)
basePath
- the base pathname
- the file or URL nametype
- the Class providing ClassLoader resource loadingpublic static Resource getResource(java.lang.String basePath, java.lang.String name, java.lang.Class type, boolean searchFiles)
basePath
- the base pathname
- the file or URL nametype
- the Class providing ClassLoader resource loadingsearchFiles
- true to search filespublic static void addSearchPath(java.lang.String base)
base
- the base path to addpublic static void removeSearchPath(java.lang.String base)
base
- the base path to removepublic static void setCacheEnabled(boolean enabled)
enabled
- true to enable the cachepublic static boolean isCacheEnabled()
public static void addExtractExtension(java.lang.String extension)
extension
- the extension to addpublic static java.io.InputStream openInputStream(java.lang.String path)
public static java.io.Reader openReader(java.lang.String path)
public static java.lang.String getString(java.lang.String path)
public static javax.swing.ImageIcon getIcon(java.lang.String path)
public static java.awt.Image getImage(java.lang.String path)
public static java.awt.image.BufferedImage getBufferedImage(java.lang.String path)
public static java.applet.AudioClip getAudioClip(java.lang.String path)