| |
|
| java.lang.Object com.izforge.izpack.installer.ResourceManager
ResourceManager | public class ResourceManager (Code) | | With this ResourceManager you are able to get resources from the jar file.
All resources are loaded language dependent as it's done in java.util.ResourceBundle. To set a
language dependent resource just append '_' and the locale to the end of the Resourcename
Example:
InfoPanel.info - for default value
InfoPanel.info_deu - for german value
InfoPanel.info_eng - for english value
This class is almost a singleton. It is created once using create by the installer
and later, the instance is retrieved using getInstance .
author: Marcus Stursberg |
resourceBasePath | final protected String resourceBasePath(Code) | | The base path where to find the resources
|
ResourceManager | protected ResourceManager(AutomatedInstallData data)(Code) | | Constructor. Protected because this is a singleton.
Parameters: data - - the current installData |
create | public static ResourceManager create(AutomatedInstallData data)(Code) | | Create the resource manager.
This method should be called only once. If it is called a second time, the already existing
instance is returned. The resource manager should be called after the language has
been set in
AutomatedInstallData.localeISO3 Parameters: data - the installation information the created instance |
getInputStream | public InputStream getInputStream(String resource) throws ResourceNotFoundException(Code) | | Returns an InputStream contains the given Resource The Resource is loaded language dependen
by the informations from this.locale If there is no Resource for the current
language found, the default Resource is given.
Parameters: resource - The resource to load an InputStream contains the requested resource exception: ResourceNotFoundException - Description of the Exception throws: ResourceNotFoundException - thrown if there is no resource found |
getInstance | public static ResourceManager getInstance()(Code) | | Return the resource manager.
the resource manager instance, null if no instance has been created |
getLocale | public String getLocale()(Code) | | Returns the locale for the resourcefiles. The locale is taken from
InstallData#installData#getAttribute("langpack") If there is no language set, the default
language is english.
the current language |
getTextResource | public String getTextResource(String resource, String encoding) throws ResourceNotFoundException, IOException(Code) | | Returns a text resource from the jar file. The resource is loaded by
ResourceManager#getResource and then converted into text.
Parameters: resource - - a text resource to load Parameters: encoding - - the encoding, which should be used to read the resource a String contains the text of the resource throws: ResourceNotFoundException - if the resource can not be found throws: IOException - if the resource can not be loaded |
getTextResource | public String getTextResource(String resource) throws ResourceNotFoundException, IOException(Code) | | Returns a text resource from the jar file. The resource is loaded by
ResourceManager#getResource and then converted into text.
Parameters: resource - - a text resource to load a String contains the text of the resource throws: ResourceNotFoundException - if the resource can not be found throws: IOException - if the resource can not be loaded |
setLocale | public void setLocale(String locale)(Code) | | Sets the locale for the resourcefiles. The locale is taken from
InstallData#installData#getAttribute("langpack") If there is no language set, the default
language is english.
Parameters: locale - of the resourcefile |
|
|
|