|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PluginConfigSource
This interface provides a mechanism for plugins to store configuration settings in a separate configuration file (rather than the main Azureus configuration file).
Important: If you are using this class for a plugin which previously
used to store configuration settings in the main configuration file
(which is what most existing plugins do), you should call the
forceSettingsMigration()
method to get existing settings moved
over - please read the comments for that file if you need to do that.
To create an instance of this file, you need to call
PluginConfig.enableExternalConfigSource()
. Once you have an instance,
you then need to call initialize()
to configure it - though there
are additional methods that you can call for additional configuration.
Note: Only for implementation by Azureus, not plugins.
Method Summary | |
---|---|
void |
forceSettingsMigration()
If your plugin previously used to store data in the main configuration file, you can call this method (which needs to be done soon after initialization) which will move all monitored parameters over to this object. |
java.io.File |
getConfigFile()
Returns a file object which represents the location of the configuration file that this object interacts with. |
void |
initialize()
This initializes this configuration object and gets the external configuration file integrated with Azureus. |
void |
save(boolean force)
Manually saves the configuration settings recorded by this object to disk. |
void |
setConfigFilename(java.lang.String filename)
This method sets the filename for the configuration file that this object links to - this must be done before the initialize()
method is called. |
Method Detail |
---|
void initialize()
It performs the following steps:
void setConfigFilename(java.lang.String filename)
initialize()
method is called.
filename
- The filename to use.java.io.File getConfigFile()
void save(boolean force)
force
- true if you want the file to be written to
regardless of whether there are any changes, false if
you only want to save the file if there are unsaved changes.void forceSettingsMigration()
You have to call this method before you initialize the object. It's also
recommended that if you call this method, that you call save(boolean)
to save any settings copied across - probably best to be done as the last thing
of the Plugin.initialize(PluginInterface)
method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |