Changeset 4510
- Timestamp:
- 2003-06-09T11:46:48+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r4494 r4510 235 235 * @see org.greenstone.gatherer.util.EmailAddress 236 236 */ 237 private BufferedReader in; 238 /** If one of the submanagers detects that it hasn't been provided enough arguments (such as format which always requires at least three) it can call this method to request another line of text from the collect.cfg. If the collect.cfg was not well formed this will cause some problems, but that can't be helped. 239 * @param prefix the String we have so far 240 * @return a String with a further line form the collect.cfg appended 241 */ 242 public String parseMore(String prefix) { 243 ///ystem.err.println("Command incomplete: " + prefix); 244 try { 245 String suffix = in.readLine(); 246 ///ystem.err.println("Adding: " + suffix); 247 if(suffix != null) { 248 prefix = prefix + " " + suffix; 249 } 250 suffix = null; 251 } 252 catch(Exception error) { 253 error.printStackTrace(); 254 } 255 return prefix; 256 } 257 237 258 public void parse(String filename) { 238 259 try { 239 260 in_file = new File(filename); 240 261 FileReader in_reader = new FileReader(in_file); 241 BufferedReaderin = new BufferedReader(in_reader);262 in = new BufferedReader(in_reader); 242 263 String command = null; 243 264 while((command = in.readLine()) != null) { 244 265 if(command.length() > 0) { 266 // Now we've finished parsing a command line, see what manager wants a piece of it. 245 267 // We have to test the end of command for the special character '\'. If found, remove it and append the next line, then repeat. 246 268 while(command.trim().endsWith("\\")) { 247 command = command.substring(0, command.lastIndexOf("\\"));248 String next_line = in.readLine();249 if(next_line != null) {269 String next_line = (in.readLine()).trim(); 270 if(next_line != null && next_line.length() > 0) { 271 command = command.substring(0, command.lastIndexOf("\\")); 250 272 command = command + next_line; 251 273 }
Note:
See TracChangeset
for help on using the changeset viewer.