Package org.bonitasoft.web.extension
Interface ResourceProvider
-
- All Known Subinterfaces:
PageResourceProvider
public interface ResourceProviderAccess to the extension resources
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FilegetResourceAsFile(String resourceName)Retrieve a resource as aFileInputStreamgetResourceAsStream(String resourceName)Retrieve a resource as anInputStreamResourceBundlegetResourceBundle(String name, Locale locale)Retrieve aResourceBundlethat can be used for localization.StringgetResourceURL(String resourceName)Retrieve a resource URL
-
-
-
Method Detail
-
getResourceAsStream
InputStream getResourceAsStream(String resourceName) throws FileNotFoundException
Retrieve a resource as anInputStream- Parameters:
resourceName- the name of the resource to retrieve. It can be a path.- Returns:
- a
InputStreamfor this resource - Throws:
FileNotFoundException
-
getResourceAsFile
File getResourceAsFile(String resourceName)
Retrieve a resource as aFile- Parameters:
resourceName- the name of the resource to retrieve. It can be a path.- Returns:
- a
Filefor this resource
-
getResourceURL
String getResourceURL(String resourceName)
Retrieve a resource URL- Parameters:
resourceName- the name of the resource to retrieve. It can be a path.- Returns:
- the URL of where the resource is available.
-
getResourceBundle
ResourceBundle getResourceBundle(String name, Locale locale)
Retrieve aResourceBundlethat can be used for localization.- Parameters:
name- the name of the resource to retrieve (e.g. : messages for a resource named messages_fr.properties)locale- theLocaleof theResourceBundleto retrieve.(e.g. : Locale.FRENCH for a resource named messages_fr.properties)- Returns:
- the
ResourceBundlefor given name andLocale
-
-