|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object SettingsLoader
public class SettingsLoader
This class is used for loading the settings of the program. It is very similar to what the DefaultSettingsLoader class does, but still the conceptual differences made me create a new class. It reads a zip archive that contains one file for each settings category that the program needs and/or separate files with settings (not in archives). Each of these files has the extension .ini for an ini-style settings category and .fstab for a fstab-style category. In this case, the ini- and the fstab- files have different structures - please see their corresponding classes for details. Also, the class reads non-archived .ini and .fstab files. The choice between zip and/or regular files lays with the user and is made through the choice of extensions in the file names.
The class will check for the supplied file names in the supplied paths (or in the defaults if nothing is supplied) and to load the settings found there. Also default is to only allow the modification of existing 'ini' settings and the addition of 'fstab' lines to the existing sections, both having previously being loaded from the default files. However, the user can easily overwrite this.
The naming convention is that the first level name of a section is the name of the file. If the user wants a different name, he can add AS FIRST LINE (also before any comments) a statemenet of the form
Name:New name
where Name is defined in Constants.NAMECHANGE and anything after the colon sign (":"), less the surrounding whitespaces, is the new used name.
DefaultSettingsLoader
,
IniSettings
,
FstabSettings
Field Summary | |
---|---|
static LocaleTools |
lt
The LocaleTools object. |
Constructor Summary | |
---|---|
SettingsLoader()
The constructor that takes the possible paths from the SETTINGSPATH filed in the Constants class and the possible names from the INISETTINGSFILE, FSTABSETTINGSFILE and ZIPSETTINGSFILE. |
|
SettingsLoader(ArrayList<String> paths)
The constructor that takes as arguments ArrayLists of possible paths. |
|
SettingsLoader(ArrayList<String> paths,
ArrayList<String> files)
The constructor that takes as arguments ArrayLists of possible paths and file names. |
|
SettingsLoader(ArrayList<String> paths,
ArrayList<String> files,
boolean hierarchical)
The constructor that takes as arguments ArrayLists of possible paths and file names. |
|
SettingsLoader(ArrayList<String> paths,
boolean hierarchical)
The constructor that takes as arguments ArrayLists of possible paths. |
|
SettingsLoader(ArrayList<String> paths,
String file)
The constructor that takes as arguments an ArrayList of possible paths and the file name. |
|
SettingsLoader(ArrayList<String> paths,
String file,
boolean hierarchical)
The constructor that takes as arguments an ArrayList of possible paths and one file name. |
|
SettingsLoader(boolean hierarchical)
The constructor that takes the possible paths from the SETTINGSPATH filed in the Constants class and the possible names from the INISETTINGSFILE, FSTABSETTINGSFILE and ZIPSETTINGSFILE. |
|
SettingsLoader(boolean hierarchical,
ArrayList<String> files)
The constructor that takes as arguments an ArrayList of possible file names. |
|
SettingsLoader(boolean dummy1,
ArrayList<String> file,
boolean dummy2)
The constructor that takes as arguments the possible names of the settings file and no hierarchical flag. |
|
SettingsLoader(boolean hierarchical,
String file)
The constructor that takes as arguments the name of the settings file and the hierarchical flag. |
|
SettingsLoader(boolean dummy1,
String file,
boolean dummy2)
The constructor that takes as arguments the name of the settings file and no hierarchical flag. |
|
SettingsLoader(String path)
The constructor that takes as argument the possible path. |
|
SettingsLoader(String path,
ArrayList<String> files)
The constructor that takes as arguments the path and an ArrayList of possible file names. |
|
SettingsLoader(String path,
ArrayList<String> files,
boolean hierarchical)
The constructor that takes as arguments the path and an ArrayList of possible file names. |
|
SettingsLoader(String path,
boolean hierarchical)
The constructor that takes as argument the possible path. |
|
SettingsLoader(String path,
String file)
The constructor that takes as arguments the path and the file name. |
|
SettingsLoader(String path,
String file,
boolean hierarchical)
The constructor that takes as arguments the path and the file name. |
Method Summary |
---|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static LocaleTools lt
LocaleTools
object.
Constructor Detail |
---|
public SettingsLoader(ArrayList<String> paths, ArrayList<String> files)
paths
- A String ArrayList containing all the possible paths where the settings files could be found.files
- A String ArrayList containing the possible names of the settings filespublic SettingsLoader(ArrayList<String> paths, ArrayList<String> files, boolean hierarchical)
paths
- A String ArrayList containing all the possible paths where the settings regular files and archives could be found.files
- A String ArrayList containing the possible names of the settings fileshierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(ArrayList<String> paths, boolean hierarchical)
paths
- A String ArrayList containing all the possible paths where the settings zip file could be found.hierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)Constants
public SettingsLoader(String path, ArrayList<String> files, boolean hierarchical)
path
- A String containing the path where the settings files could be found.files
- A String ArrayList containing the possible names of the settings fileshierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(String path, boolean hierarchical)
path
- A String containing all the possible paths where the settings files could be found.hierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)Constants
public SettingsLoader(ArrayList<String> paths, String file, boolean hierarchical)
paths
- A String ArrayList containing all the possible paths where the settings files could be found.file
- A String with the name of the settings file.hierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(String path, String file, boolean hierarchical)
path
- A String with the path where the settings file could be found.file
- A String with the name of the settings file.hierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(ArrayList<String> paths)
paths
- A String ArrayList containing all the possible paths where the settings files could be found.Constants
public SettingsLoader(String path, ArrayList<String> files)
path
- A String containing the path where the settings files could be found.files
- A String ArrayList containing the possible names of the settings filespublic SettingsLoader(String path)
path
- A String containing all the possible paths where the settings files could be found.Constants
public SettingsLoader(ArrayList<String> paths, String file)
paths
- A String ArrayList containing all the possible paths where the settings files could be found.file
- A String with the name of the settings file.public SettingsLoader(boolean hierarchical, ArrayList<String> files)
files
- A String ArrayList containing all the possible names of the settings fileshierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(boolean hierarchical, String file)
file
- The name of the settings filehierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader(boolean dummy1, String file, boolean dummy2)
file
- The name of the settings filedummy1
- Dummy variable used only to create a different signaturedummy2
- Dummy variable used only to create a different signaturepublic SettingsLoader(boolean dummy1, ArrayList<String> file, boolean dummy2)
file
- The name of the settings filedummy1
- Dummy variable used only to create a different signaturedummy2
- Dummy variable used only to create a different signaturepublic SettingsLoader(boolean hierarchical)
hierarchical
- A flag indicating whether the settings structure is hierarchical (true) or not (false)public SettingsLoader()
public SettingsLoader(String path, String file)
path
- A String with the path where the settings file could be found.file
- A String with the name of the settings file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |