|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.services.resource.ResourceLocator
This class provides utility methods for locating classes and resource files in the class path, and for accessing classes and resource files
Constructor Summary | |
ResourceLocator()
Default Constructor |
Method Summary | |
static java.net.URL |
getClassInClassPath(java.lang.Class clazz,
java.lang.String className,
java.util.Locale locale)
This method gets the URL for the specified class and locale. |
static java.net.URL |
getClassInClassPath(java.lang.String className)
This method gets the URL for the specified class. |
static java.net.URL |
getClassInClassPath(java.lang.String className,
java.util.Locale locale)
This method gets the URL for the specified class and locale . |
static java.net.URL |
getFileInClassPath(java.lang.String fullFileName)
This method gets the URL for the specified file. |
static java.net.URL |
getFileInClassPath(java.lang.String fileName,
java.lang.String fileExtension)
This method gets the URL for the specified file. |
static java.io.InputStream |
getInputStream(java.net.URL url)
This method gets an InputStream for the specified URL. |
static long |
getLastModified(java.net.URL url)
This method returns the time (in milliseconds since 01/01/1970) that the resource was last modified. |
static java.io.OutputStream |
getOutputStream(java.net.URL url)
This method gets an OutputStream for the specified URL. |
static java.net.URL |
getResourceInClassPath(java.lang.Class clazz,
java.lang.String resourceName,
java.util.Locale locale)
This method gets the URL for the specified resource and locale . |
static java.net.URL |
getResourceInClassPath(java.lang.String resourceName)
This method gets the URL for the specified resource and locale . |
static java.net.URL |
getResourceInClassPath(java.lang.String resourceName,
java.util.Locale locale)
This method gets the URL for the specified resource and locale . |
static boolean |
isReadOnly(java.net.URL url)
This method checks if the specified resource is read only. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceLocator()
Method Detail |
public static java.net.URL getClassInClassPath(java.lang.Class clazz, java.lang.String className, java.util.Locale locale)
com.bankframe.resource.ResourceLocator
. This method will
locate the nearest matching locale to the one requested. This method will
return null if the class cannot be found in the classpath.
clazz
- the Class instance to use to search the class pathclassName
- the name of the classlocale
- the locale
public static java.net.URL getClassInClassPath(java.lang.String className)
com.bankframe.resource.ResourceLocator
.
This method will return null if the class cannot be found in the class path.
className
- the name of the class
public static java.net.URL getClassInClassPath(java.lang.String className, java.util.Locale locale)
com.bankframe.resource.ResourceLocator
.
This method will locate the nearest matching locale to the one requested. This method
will return null if the class cannot be found in the class path.
className
- the name of the classlocale
- the locale
public static java.net.URL getFileInClassPath(java.lang.String fullFileName)
fullFileName
- the name of the file to search for in the classpath
public static java.net.URL getFileInClassPath(java.lang.String fileName, java.lang.String fileExtension)
fileName
- the name of the file (excluding the extension)fileExtension
- the file extension (e.g. .jpg, .gif)
public static java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
url
- the URL of the resource
java.io.IOException
public static long getLastModified(java.net.URL url)
url
- the URL of the resource
public static java.io.OutputStream getOutputStream(java.net.URL url) throws java.io.IOException
java.io.IOException
being thrown.
url
- the URL of the resource
java.io.IOException
- if the resource is read-onlypublic static java.net.URL getResourceInClassPath(java.lang.Class clazz, java.lang.String resourceName, java.util.Locale locale)
com.bankframe.localization.messages.BankframeMessages
.
This method will locate the nearest matching locale to the one requested. This method
will return null if the resource cannot be found in the classpath.
clazz
- The Class instance to use to search the class pathresourceName
- Name of the resourcelocale
- The locale
public static java.net.URL getResourceInClassPath(java.lang.String resourceName)
com.bankframe.localization.messages.BankframeMessages
.
This method will locate the nearest matching locale to the one requested. This
method will return null if the resource cannot be found in the classpath.
resourceName
- Name of the resource
public static java.net.URL getResourceInClassPath(java.lang.String resourceName, java.util.Locale locale)
com.bankframe.localization.messages.BankframeMessages
.
This method will locate the nearest matching locale to the one requested. This method
will return null if the resource cannot be found in the classpath.
resourceName
- the nName of the resourcelocale
- the locale
public static boolean isReadOnly(java.net.URL url)
url
- the URL of the resource
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |