|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.cadx.common.preference.ParamPropReader
Nested Class Summary | |
class |
ParamPropReader.SectionProperties
|
Field Summary | |
private BufferedReader |
buf
|
static String |
comment
|
private String |
currentSectionName
|
private ParamPropReader.SectionProperties |
currentStore
|
(package private) static boolean |
debug
|
private boolean |
dirty
|
private Hashtable |
hash
|
private String |
location
|
private String |
locationOld
|
private String |
locationTmp
|
private File |
origFile
This method can be used to write the correct properties object at its "location" (provided write permissions are available). |
private static String |
RESOURCE
|
private Vector |
secReadSeq
|
private static String |
space
|
private File |
tmpFile
This method can be used to write the correct properties object at its "location" (provided write permissions are available). |
Constructor Summary | |
ParamPropReader(InputStream stream,
URL loc)
|
|
ParamPropReader(String loc)
constructor where empty reader is created |
|
ParamPropReader(URL loc)
|
Method Summary | |
void |
addParameter(String key,
String val,
String section)
|
private String |
checkSectionName(String sec)
|
private File |
createBackUp()
This method a backup copy of the original $datasource.ini file in $datasource.ini.old and returns a file handle for $datasource.ini.old. |
void |
deleteParameter(String key,
String val,
String section)
|
private void |
deleteTmpFile(File file)
This method deletes the file passed to it, catching any security exceptions and displaying an error message if the exception is caught. |
void |
dump()
|
String[] |
getAllSectionKeyVals(String secName)
|
private String |
getLocationOld()
|
private OutputStream |
getOutputStream(String urlLoc)
|
String |
getPropValue(String key)
|
String |
getPropValueFromSection(String key,
String secName)
|
Enumeration |
getSectionKeys(String secName)
|
Enumeration |
getSections()
|
private void |
processLine(String line)
The file is in ini file format hence data is arranged as Sections and key value pairs like following example [file] IniName=User:shaijosh [explorer] mode=gmode registry_port=2009 registry_server=santoor .... |
private void |
readProperties()
the readProperties() method is also state defined as follows: readState: Condition (entry from state) 0 : initialized 1 : started default section (0) 2 : readKeyValue (1, 3) 3 : got new Section (2) |
private void |
recoverOrigFile()
This method copies the backup of the original $datasource.ini file, $datasource.ini.old, to $datasource.ini. |
void |
save(File file,
File origFile)
|
boolean |
writeIniFile()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final boolean debug
private BufferedReader buf
private Hashtable hash
private Vector secReadSeq
private ParamPropReader.SectionProperties currentStore
private String currentSectionName
private String location
private String locationOld
private String locationTmp
private boolean dirty
public static final String comment
private static final String space
private static final String RESOURCE
private File origFile
private File tmpFile
Constructor Detail |
public ParamPropReader(URL loc) throws IOException
public ParamPropReader(String loc)
public ParamPropReader(InputStream stream, URL loc)
Method Detail |
public void addParameter(String key, String val, String section)
public void deleteParameter(String key, String val, String section)
private void readProperties() throws IOException
IOException
private String checkSectionName(String sec)
private void processLine(String line)
public String getPropValue(String key)
public String getPropValueFromSection(String key, String secName)
public Enumeration getSections()
public Enumeration getSectionKeys(String secName)
public String[] getAllSectionKeyVals(String secName)
public void dump()
public boolean writeIniFile() throws IOException
IOException
public void save(File file, File origFile)
private File createBackUp() throws IOException
IOException
private void deleteTmpFile(File file) throws IOException
IOException
private void recoverOrigFile() throws IOException
IOException
private OutputStream getOutputStream(String urlLoc)
private String getLocationOld()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |