public class ResourceManager
extends java.lang.Object
It provides a standard mechanism for developers to handle resources management operations.
Constructor and Description |
---|
ResourceManager() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createFile(java.io.File folder,
java.lang.String name)
Creates a file with the given name in the given folder.
|
static java.io.File[] |
getAll(java.io.File folder)
Gets all the files in the given folder.
|
static java.lang.Class<?>[] |
getClasses(java.lang.Package pkg)
Deprecated.
|
static java.lang.Class<?>[] |
getClasses(java.lang.Package pkg,
boolean allowAbstract)
Deprecated.
|
static java.io.File |
getFileOfTypes(java.io.File folder,
java.lang.String name,
java.lang.String... extensions)
Gets the file with given search criteria.
|
static java.io.File[] |
getFiles(java.io.File folder,
java.lang.String... extensions)
Gets the files in a given folder.
|
static java.io.File |
getResourceFile(java.lang.String... pathParts)
Deprecated.
|
static java.io.InputStream |
getResourceStream(java.lang.String name) |
static java.net.URI |
getResourceURI(java.lang.String... pathParts)
Finds the URI of the resource with the given path parts.
|
static java.net.URL |
getResourceURL(java.lang.String... pathParts)
Finds the resource with the given path parts.
|
static java.io.File[] |
getSubDirs(java.io.File folder)
Gets the sub directories in the given directory.
|
public static java.io.InputStream getResourceStream(java.lang.String name)
name
- Name of the specified resource.public static java.net.URL getResourceURL(java.lang.String... pathParts)
pathParts
- The path to look in represented as an array of strings. This is useful in different platforms where each
platform has it's own file separator.public static java.net.URI getResourceURI(java.lang.String... pathParts)
pathParts
- The path to look in represented as an array of strings. This is useful in different platforms where each
platform has it's own file separator.@Deprecated public static java.io.File getResourceFile(java.lang.String... pathParts)
pathParts
- The path to look in represented as an array of strings. This is useful in different platforms where each
platform has it's own file separator.@Deprecated public static java.lang.Class<?>[] getClasses(java.lang.Package pkg)
pkg
- Package to look in.@Deprecated public static java.lang.Class<?>[] getClasses(java.lang.Package pkg, boolean allowAbstract)
pkg
- Package to look in.allowAbstract
- Flag to indicate if the class abstract to be find.public static java.io.File[] getSubDirs(java.io.File folder)
folder
- Folder to look in.public static java.io.File[] getAll(java.io.File folder)
folder
- Folder to look in.public static java.io.File[] getFiles(java.io.File folder, java.lang.String... extensions)
folder
- The folder to look in.extensions
- extensions of the files to look for.public static java.io.File getFileOfTypes(java.io.File folder, java.lang.String name, java.lang.String... extensions)
folder
- The folder to look in.name
- The starting part of the file name.extensions
- Extensions to look for.public static java.io.File createFile(java.io.File folder, java.lang.String name) throws java.io.IOException
folder
- The folder in which the file should be created.name
- The name of the file to be created.File
created by this method.java.io.IOException