Changeset 25635 for main/trunk/greenstone3/src/java/org/greenstone/util
- Timestamp:
- 2012-05-22T13:01:04+12:00 (12 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/util/Configuration.java
r22085 r25635 42 42 public class Configuration { 43 43 44 static private Hashtable hash = null;44 static private Hashtable<String, String> hash = null; 45 45 46 46 /** The first of three patterns used during tokenization, this pattern handles a comma separated list. */ … … 53 53 public Configuration() { 54 54 55 hash = new Hashtable ();55 hash = new Hashtable<String, String>(); 56 56 57 57 … … 76 76 /** Retrieve whether the named property is set or not */ 77 77 static public boolean get(String property) { 78 String value = (String)hash.get(property);78 String value = hash.get(property); 79 79 return (value != null && value.equalsIgnoreCase("true")); 80 80 } … … 82 82 /** Retrieve the value of the named property as a String */ 83 83 static public String getString(String property) { 84 return (String)hash.get(property);84 return hash.get(property); 85 85 } 86 86 … … 89 89 Locale result = Locale.getDefault(); 90 90 try { 91 String raw = (String)hash.get(property);91 String raw = hash.get(property); 92 92 if (raw==null) { 93 93 return result; … … 113 113 static public Color getColor(String property) { 114 114 Color result = Color.white; // Default 115 String raw = (String)hash.get(property);115 String raw = hash.get(property); 116 116 if (raw == null || raw.equals("")) { 117 117 return result; -
main/trunk/greenstone3/src/java/org/greenstone/util/ScriptReadWrite.java
r22085 r25635 15 15 } 16 16 17 public ArrayList readInFile(File file) {17 public ArrayList<String> readInFile(File file) { 18 18 try { 19 ArrayList fileLines = new ArrayList();19 ArrayList<String> fileLines = new ArrayList<String>(); 20 20 String oneLine = null; 21 21 BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); … … 31 31 } 32 32 33 public void writeOutFile(File file, ArrayList fileLines_in) {33 public void writeOutFile(File file, ArrayList<String> fileLines_in) { 34 34 try { 35 35 PrintWriter printWriter = new PrintWriter(new BufferedWriter(new FileWriter(file))); … … 44 44 } 45 45 46 public ArrayList queryReplace(ArrayListfileLines_ex, String param,46 public ArrayList<String> queryReplace(ArrayList<String> fileLines_ex, String param, 47 47 String newValue) { 48 48 // only replace existing, don't append if param does not exist … … 52 52 // if the parameter exists, then a replace is performed, else the parameter-value 53 53 // is appended 54 public ArrayList replaceOrAddLine(ArrayListfileLines_ex, String param, String newValue,54 public ArrayList<String> replaceOrAddLine(ArrayList<String> fileLines_ex, String param, String newValue, 55 55 boolean replaceElseAdd) 56 56 { … … 63 63 64 64 for (int i = 0; i < fileLines_ex.size(); i++) { 65 oneLine = ((String) fileLines_ex.get(i)).trim();65 oneLine = fileLines_ex.get(i).trim(); 66 66 // oneLine_length = oneLine.length(); 67 67 StringTokenizer st = new StringTokenizer(oneLine, "=");
Note:
See TracChangeset
for help on using the changeset viewer.