summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/convwatch/IniFile.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-13 10:08:31 +0200
committerNoel Grandin <noel@peralex.com>2014-08-13 10:24:10 +0200
commit34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch)
tree4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /qadevOOo/runner/convwatch/IniFile.java
parent347926e8e57c1825261daa46c1886aa2ebf9571b (diff)
java: remove dead methods
found by UCDetector Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'qadevOOo/runner/convwatch/IniFile.java')
-rw-r--r--qadevOOo/runner/convwatch/IniFile.java81
1 files changed, 0 insertions, 81 deletions
diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java
index 1b3f46942dc5..dc3b55a50774 100644
--- a/qadevOOo/runner/convwatch/IniFile.java
+++ b/qadevOOo/runner/convwatch/IniFile.java
@@ -267,91 +267,10 @@ class IniFile
return sValue;
}
- /**
- write back the ini file to the disk, only if there exist changes
- */
- public void store()
- {
- if (m_bListContainUnsavedChanges == false)
- {
- // nothing has changed, so no need to store
- return;
- }
- File aFile = new File(m_sFilename);
- if (aFile.exists())
- {
- aFile.delete();
- if (aFile.exists())
- {
- GlobalLogWriter.get().println("Couldn't delete the file " + m_sFilename);
- return;
- }
- }
- try
- {
- RandomAccessFile aWriter = new RandomAccessFile(aFile, "rw");
- for (int i=0; i<m_aList.size();i++)
- {
- String sLine = getItem(i);
- aWriter.writeBytes(sLine);
- aWriter.writeByte('\n');
- }
- aWriter.close();
- }
- catch (java.io.FileNotFoundException fne)
- {
- GlobalLogWriter.get().println("couldn't open file for writing " + m_sFilename);
- GlobalLogWriter.get().println("Message: " + fne.getMessage());
- }
- catch(java.io.IOException ie)
- {
- GlobalLogWriter.get().println("Exception occurs while writing to file " + m_sFilename);
- GlobalLogWriter.get().println("Message: " + ie.getMessage());
- }
- }
- /**
- insert a value
- there are 3 cases
- 1. section doesn't exist, goto end and insert a new section, insert a new key value pair
- 2. section exist but key not, search section, search key, if key is -1 get last known key position and insert new key value pair there
- 3. section exist and key exist, remove the old key and insert the key value pair at the same position
- */
- public void insertValue(String _sSection, String _sKey, String _sValue)
- {
- int i = findSection(_sSection);
- if (i == -1)
- {
- // case 1: section doesn't exist
- String sFindSection = buildSectionName(_sSection);
-
- m_aList.add(sFindSection);
- String sKeyValuePair = _sKey + "=" + _sValue;
- m_aList.add(sKeyValuePair);
- m_bListContainUnsavedChanges = true;
- return;
- }
- int j = findKeyFromKnownSection(i, _sKey);
- if (j == -1)
- {
- // case 2: section exist, but not the key
- j = findLastKnownKeyIndex(i, _sKey);
- String sKeyValuePair = _sKey + "=" + _sValue;
- m_aList.add(j, sKeyValuePair);
- m_bListContainUnsavedChanges = true;
- return;
- }
- else
- {
- // case 3: section exist, and also the key
- String sKeyValuePair = _sKey + "=" + _sValue;
- m_aList.set(j, sKeyValuePair);
- m_bListContainUnsavedChanges = true;
- }
- }
}