|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.importer.parser.ethernet.ConfigFile
public class ConfigFile
A ConfigFile object represents a configuration file of the /etc/sysconfig/network-scripts directory. These files are ini-style files containing only one section. A section in a ini-style file consists of option lines:
To parse the file the package ch.ubique.inieditor is used.
ConfigFile provides methods to return the values to an option name, and to construct a VeriNeC <nw> XML element with the data of the configuration file.
| Field Summary | |
|---|---|
private ch.ubique.inieditor.IniEditor.Section |
confData
|
private ImporterEnvironment |
config
|
private File |
file
|
(package private) Logger |
log
|
private List |
optionlist
|
private List |
unhandled
|
| Constructor Summary | |
|---|---|
ConfigFile(File file,
ImporterEnvironment config)
Construct a new ConfigFile by reading the File file. |
|
| Method Summary | |
|---|---|
private Element |
generateDns(String DNS)
Create a VeriNeC <dns> element with the specifications of the file. |
private Element |
generateDyn()
Create a VeriNeC <dyn> XML element with the specifications of the file. |
String |
getValue(String var)
Get the value of a option defined in the file. |
boolean |
hasVariable(String var)
Check if a option is defined in the file. |
Element |
nw()
Create a VeriNec <nw> XML element with the specifications of the file. |
List |
options()
Get the list of all options of the file. |
private ch.ubique.inieditor.IniEditor.Section |
readFile()
Read the file specified in the constructor and return it as a IniEditor.Section value. |
void |
removeOption(String opt)
Remove the option name opt from the list unhandled. |
List |
unhandledOptions()
Get the list of all options of the file that are not handled while creating the VeriNec <nw> XML element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
Logger log
private ImporterEnvironment config
private List optionlist
private List unhandled
private File file
private ch.ubique.inieditor.IniEditor.Section confData
| Constructor Detail |
|---|
public ConfigFile(File file,
ImporterEnvironment config)
throws VerinecImporterException
file - The inistyle file to construct a ConfigFile object. Must exist.config - The environment.
VerinecImporterException - If anything goes wrong.| Method Detail |
|---|
private ch.ubique.inieditor.IniEditor.Section readFile()
throws VerinecImporterException
VerinecImporterException - If the file can not be read.public Element nw()
public List options()
public List unhandledOptions()
public void removeOption(String opt)
opt - The name of the option.public String getValue(String var)
var - the name of the option.
public boolean hasVariable(String var)
var - The name of the option to look for.
private Element generateDyn()
private Element generateDns(String DNS)
DNS - The dns server name
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||