cz.vity.freerapid.plugins.webclient.interfaces
Interface ConfigurationStorageSupport

All Known Implementing Classes:
StandardStorageSupportImpl

public interface ConfigurationStorageSupport

Class that provides locale storage support for plugins.
Plugins use instance of this interface to access local file system to store their information - eg. premium account info. Implementation uses XMLEncoder to store beans data into XML.

Author:
Ladislav Vitasek

Method Summary
 boolean configFileExists(String fileName)
          Checks whether configuration file exists (if any configuration was created before)
<E> E
loadConfigFromFile(String fileName, Class<E> type)
          Method loads configuration data from file into Object.
 void storeConfigToFile(Object object, String fileName)
          Method store plugin's configuration data from Object into file.
 

Method Detail

loadConfigFromFile

<E> E loadConfigFromFile(String fileName,
                         Class<E> type)
                     throws Exception
Method loads configuration data from file into Object. Intern implementation uses XMLEncoder.

Parameters:
fileName - file name for storing data - it's recommended to use 'plugin_id.xml'
type - class of the stored object
Returns:
returns new instance, null if
Throws:
Exception - throwed when reading went wrong
See Also:
load method

storeConfigToFile

void storeConfigToFile(Object object,
                       String fileName)
                       throws Exception
Method store plugin's configuration data from Object into file. Intern implementation uses XMLEncoder.

Parameters:
fileName - file name for storing data - it's recommended to use 'plugin_id.xml'
Throws:
Exception - throwed when reading went wrong
See Also:
save method

configFileExists

boolean configFileExists(String fileName)
Checks whether configuration file exists (if any configuration was created before)

Parameters:
fileName - file name
Returns:
true - if there is such file in configuration directory, false otherwise