public class ResourceLocator extends Object
Description: Get internationalized resource.
Copyright: Copyright (c) 2006
Company: www.justdos.net
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
UNIX_SEPERATOR |
static char |
UNIX_SEPERATOR_CHAR |
static String |
WINDOWS_SEPERATOR |
static char |
WINDOWS_SEPERATOR_CHAR |
| 构造器和说明 |
|---|
ResourceLocator() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected static ClassLoader |
getContextClassLoader()
Return the thread context class loader if available.
|
static URL |
getResource(Class class1,
String resName)
Finds the resource with the given class and name.
|
static URL |
getResource(Class class1,
String resName,
Locale locale)
Finds the resource with the given class and name.
|
static URL |
getResource(String resName)
Gets internationalized resource.
|
static URL |
getResource(String resName,
Locale locale)
Gets internationalized resource.
|
static File |
getResourceAsFile(String resHome,
String resName)
Gets internationalized file resource.
|
static File |
getResourceAsFile(String resHome,
String resName,
Locale locale)
Gets internationalized file resource.
|
static InputStream |
getResourceAsStream(Class class1,
String resource)
Returns an input stream for reading the specified resource with the
given class.
|
static InputStream |
getResourceAsStream(Class class1,
String resource,
Locale locale)
Returns an input stream for reading the specified resource with the
given class.
|
static InputStream |
getResourceAsStream(String resName)
Gets internationalized resource as stream.
|
static InputStream |
getResourceAsStream(String resName,
Locale locale)
Gets internationalized resource as stream.
|
public static final char UNIX_SEPERATOR_CHAR
public static final char WINDOWS_SEPERATOR_CHAR
public static File getResourceAsFile(String resHome, String resName, Locale locale)
resHome - directory name the resource file lies inresName - resource file namelocale - Locale instancepublic static File getResourceAsFile(String resHome, String resName)
resHome - directory name the resource file lies inresName - resource file namepublic static URL getResource(String resName, Locale locale)
resName - resource namelocale - Locale instancepublic static URL getResource(String resName)
resName - resource namepublic static InputStream getResourceAsStream(String resName, Locale locale)
resName - resource namelocale - Locale instancepublic static InputStream getResourceAsStream(String resName)
resName - resource nameprotected static ClassLoader getContextClassLoader()
public static URL getResource(Class class1, String resName, Locale locale)
class1 - The class which will load the resourceresName - resource namelocale - Locale instancepublic static URL getResource(Class class1, String resName)
class1 - The class which will load the resourceresName - resource namepublic static InputStream getResourceAsStream(Class class1, String resource, Locale locale)
class1 - The class which will load the resourceresource - resource namelocale - Locale instancepublic static InputStream getResourceAsStream(Class class1, String resource)
class1 - The class which will load the resourceresource - resource nameCopyright © 2023 onecode. All rights reserved.