|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsecurity.io.ResourceUtils
public class ResourceUtils
Static helper methods for loading resources.
| Field Summary | |
|---|---|
static String |
CLASSPATH_PREFIX
Resource path prefix that specifies to load from a classpath location, value is classpath: |
static String |
FILE_PREFIX
Resource path prefix that specifies to load from a file location, value is file: |
static String |
URL_PREFIX
Resource path prefix that specifies to load from a url location, value is url: |
| Method Summary | |
|---|---|
static void |
close(InputStream is)
|
static InputStream |
getInputStreamForPath(String resourcePath)
Returns the InputStream for the resource represented by the specified path. |
static boolean |
hasResourcePrefix(String resourcePath)
Returns true if the resource path is not null and starts with one of the recognized
resource prefixes (CLASSPATH_PREFIX,
URL_PREFIX, or FILE_PREFIX), false otherwise. |
static boolean |
resourceExists(String resourcePath)
Returns true if the resource at the specified path exists, false otherwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CLASSPATH_PREFIX
classpath:
public static final String URL_PREFIX
url:
public static final String FILE_PREFIX
file:
| Method Detail |
|---|
public static boolean hasResourcePrefix(String resourcePath)
true if the resource path is not null and starts with one of the recognized
resource prefixes (CLASSPATH_PREFIX,
URL_PREFIX, or FILE_PREFIX), false otherwise.
resourcePath - the resource path to check
true if the resource path is not null and starts with one of the recognized
resource prefixes, false otherwise.public static boolean resourceExists(String resourcePath)
true if the resource at the specified path exists, false otherwise.
resourcePath - the path of the resource to check.
true if the resource at the specified path exists, false otherwise.
public static InputStream getInputStreamForPath(String resourcePath)
throws IOException
The supporting prefixes are defined as as *_PREFIX constants in this class.
resourcePath - the String path representing the resource to obtain.
IOException - if there is a problem acquiring the resource at the specified path.public static void close(InputStream is)
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||