Changeset 2141
- Timestamp:
- 2001-03-09T11:49:24+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/util/NzdlIORs.java
r2140 r2141 142 142 } 143 143 } catch (ClassNotFoundException exception) { 144 System.err.println("Error locking class:" + exception); 145 } 146 147 144 System.err.println("Exception locking class:" + exception); 145 } 146 147 148 try { 148 149 File file = new File(propertiesFileName); 149 try {150 150 if (file.exists()) { 151 151 knownIORs.load(new FileInputStream(file)); 152 152 } 153 153 } catch (IOException exception) { 154 System.err.println("E rrorreading properties file:" + exception);154 System.err.println("Exception reading properties file:" + exception); 155 155 } 156 156 } … … 254 254 } 255 255 } catch (ClassNotFoundException exception) { 256 System.err.println("E rrorlocking class:" + exception);256 System.err.println("Exception locking class:" + exception); 257 257 } 258 258 checkSave(); … … 269 269 { 270 270 checkLoaded(); 271 synchronized (knownIORs) { 272 knownIORs.put(str,""); 273 } 271 if (str != null) 272 synchronized (knownIORs) { 273 knownIORs.put(str,""); 274 } 274 275 checkSave(); 275 276 return str; … … 295 296 ior = dhis.readLine(); 296 297 297 synchronized (knownIORs) { 298 knownIORs.put(ior,""); 299 } 298 if (ior != null) 299 synchronized (knownIORs) { 300 knownIORs.put(ior,""); 301 } 300 302 checkSave(); 301 303 return ior; … … 326 328 System.err.println("Error reading IOR file:\n" + e); 327 329 } 328 synchronized (knownIORs) { 329 knownIORs.put(ior,""); 330 } 330 if (ior != null) 331 synchronized (knownIORs) { 332 knownIORs.put(ior,""); 333 } 331 334 checkSave(); 332 335 return ior; … … 343 346 public static void writeToFile(String file) { 344 347 checkLoaded(); 345 synchronized (knownIORs) { 346 String ior = null; 347 file = file.trim(); 348 try { 349 BufferedWriter output 350 = new BufferedWriter(new FileWriter(file)); 351 Enumeration e = knownIORs.keys(); 352 while (e.hasMoreElements()) { 353 String IOR = (String) e.nextElement(); 354 output.write(IOR); 355 output.newLine(); 356 } 357 } catch (java.io.IOException e) { 358 System.err.println("Error reading IOR file:\n" + e); 359 } 360 } 348 if (file != null) 349 synchronized (knownIORs) { 350 String ior = null; 351 file = file.trim(); 352 try { 353 BufferedWriter output 354 = new BufferedWriter(new FileWriter(file)); 355 Enumeration e = knownIORs.keys(); 356 while (e.hasMoreElements()) { 357 String IOR = (String) e.nextElement(); 358 output.write(IOR); 359 output.newLine(); 360 } 361 } catch (java.io.IOException e) { 362 System.err.println("Error reading IOR file:\n" + e); 363 } 364 } 361 365 } // end of getIorKey 362 366 363 367 364 368 /**
Note:
See TracChangeset
for help on using the changeset viewer.