Changeset 8236 for trunk/gli/src/org/greenstone/gatherer/file
- Timestamp:
- 2004-10-08T09:46:12+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/file
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r8231 r8236 30 30 import javax.swing.table.*; 31 31 import org.greenstone.gatherer.Configuration; 32 import org.greenstone.gatherer.DebugStream; 32 33 import org.greenstone.gatherer.Dictionary; 33 34 import org.greenstone.gatherer.Gatherer; … … 80 81 } 81 82 else { 82 Gatherer.println("Didn't parse anything. About to crash.");83 DebugStream.println("Didn't parse anything. About to crash."); 83 84 } 84 85 } … … 91 92 92 93 public String getBrowserCommand(String url) { 93 Gatherer.println("Get browser command: " + url);94 DebugStream.println("Get browser command: " + url); 94 95 // First off we try to retrieve one from the configuration 95 96 String command = Configuration.getPreviewCommand(); … … 97 98 if(command != null && command.length() > 0) { 98 99 command = command.replaceAll("%1", url); 99 Gatherer.println("Result = " + command);100 DebugStream.println("Result = " + command); 100 101 return command; 101 102 } … … 134 135 Configuration.setPreviewCommand(command); 135 136 command = command.replaceAll(FILENAME_ARG, url); 136 Gatherer.println("Result = " + command);137 DebugStream.println("Result = " + command); 137 138 return command; 138 139 } 139 140 // if we haven't got a command by now, we'll never get one 140 Gatherer.println("Result = null");141 DebugStream.println("Result = null"); 141 142 return null; 142 143 … … 280 281 281 282 public void setCommand(String extension, String command) { 282 Gatherer.println("Set Launch: " + extension + " with " + command);283 DebugStream.println("Set Launch: " + extension + " with " + command); 283 284 // Retrieve any existing entry for this extension 284 285 Element entry = getCommand(extension); -
trunk/gli/src/org/greenstone/gatherer/file/FileNode.java
r8231 r8236 8 8 import javax.swing.tree.*; 9 9 import org.greenstone.gatherer.Configuration; 10 import org.greenstone.gatherer.DebugStream; 10 11 import org.greenstone.gatherer.Dictionary; 11 12 import org.greenstone.gatherer.Gatherer; … … 215 216 /** Adds child to the receiver at index. */ 216 217 public void insert(MutableTreeNode child, int index) { 217 Gatherer.println("Insert " + child + " in " + this + " at index " + index + " [Model: " + model + "]");218 DebugStream.println("Insert " + child + " in " + this + " at index " + index + " [Model: " + model + "]"); 218 219 if (child == null) { 219 220 return; … … 339 340 if(files != null && files.length > 0) { 340 341 // Sort the remaining files. 341 Gatherer.println("Number of files to sort: " + files.length);342 DebugStream.println("Number of files to sort: " + files.length); 342 343 ArrayTools.sort(files); 343 Gatherer.println("Files sorted.");344 DebugStream.println("Files sorted."); 344 345 // Now add them to children. 345 346 raw_children = new ArrayList(); -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r8231 r8236 33 33 import javax.swing.tree.*; 34 34 import org.greenstone.gatherer.Configuration; 35 import org.greenstone.gatherer.DebugStream; 35 36 import org.greenstone.gatherer.Dictionary; 36 37 import org.greenstone.gatherer.Gatherer; … … 123 124 FileJob job = new FileJob(id, source, child, target, parent, type, undo, undoable); 124 125 job.folder_level = folder_level; 125 Gatherer.println("Adding job: " + job);126 DebugStream.println("Adding job: " + job); 126 127 if(position != -1 && position <= queue.size() + 1) { 127 128 queue.add(position, job); … … 320 321 // If we can't find the source file, then the most likely reason is that the file system has changed since the last time it was mapped. Warn the user that the requested file can't be found, then force a refresh of the source folder involved. 321 322 catch(FileNotFoundException fnf_exception) { 322 Gatherer.printStackTrace(fnf_exception);323 DebugStream.printStackTrace(fnf_exception); 323 324 cancel_action = true; 324 325 // Show warning. … … 328 329 } 329 330 catch(FileAlreadyExistsException fae_exception) { 330 Gatherer.printStackTrace(fae_exception);331 DebugStream.printStackTrace(fae_exception); 331 332 cancel_action = true; 332 333 // Show warning. … … 335 336 } 336 337 catch(InsufficientSpaceException is_exception) { 337 Gatherer.printStackTrace(is_exception);338 DebugStream.printStackTrace(is_exception); 338 339 cancel_action = true; 339 340 // Show warning. The message body of the expection explains how much more space is required for this file copy. … … 342 343 } 343 344 catch(UnknownFileErrorException ufe_exception) { 344 Gatherer.printStackTrace(ufe_exception);345 DebugStream.printStackTrace(ufe_exception); 345 346 cancel_action = true; 346 347 // Show warning … … 349 350 } 350 351 catch(WriteNotPermittedException wnp_exception) { 351 Gatherer.printStackTrace(wnp_exception);352 DebugStream.printStackTrace(wnp_exception); 352 353 cancel_action = true; 353 354 // Show warning … … 357 358 catch(IOException exception) { 358 359 // Can't really do much about this. 359 Gatherer.printStackTrace(exception);360 DebugStream.printStackTrace(exception); 360 361 } 361 362 // If not cancelled … … 543 544 } 544 545 else { 545 Gatherer.println("I've already done this job twice. I refuse to requeue it again!!");546 DebugStream.println("I've already done this job twice. I refuse to requeue it again!!"); 546 547 } 547 548 } … … 595 596 } 596 597 catch (Exception error) { 597 Gatherer.printStackTrace(error);598 DebugStream.printStackTrace(error); 598 599 } 599 600 } … … 675 676 // Check if the origin file exists. 676 677 if(!source.exists()) { 677 Gatherer.println("Couldn't find the source file.");678 DebugStream.println("Couldn't find the source file."); 678 679 throw(new FileNotFoundException()); 679 680 } -
trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java
r7633 r8236 3 3 import java.io.File; 4 4 import javax.swing.filechooser.FileSystemView; 5 import org.greenstone.gatherer.DebugStream; 5 6 import org.greenstone.gatherer.Dictionary; 6 import org.greenstone.gatherer.Gatherer;7 7 import org.greenstone.gatherer.file.FileNode; 8 8 import org.greenstone.gatherer.util.ArrayTools; … … 55 55 56 56 // Make sure we're running on a multiuser OS where the idea of a "user home" is valid 57 Gatherer.println("Property os.name: " + os_name);57 DebugStream.println("Property os.name: " + os_name); 58 58 String os_name_lc = os_name.toLowerCase(); 59 59 if (os_name_lc.equals("windows 95") || os_name_lc.equals("windows 98") || os_name_lc.equals("windows me")) { -
trunk/gli/src/org/greenstone/gatherer/file/FileSystemModel.java
r7491 r8236 6 6 import javax.swing.event.*; 7 7 import javax.swing.tree.*; 8 import org.greenstone.gatherer.DebugStream; 8 9 import org.greenstone.gatherer.Dictionary; 9 10 import org.greenstone.gatherer.Gatherer; … … 59 60 FileNode first_node = (FileNode)path.getPathComponent(0); 60 61 if(current.equals(first_node)) { 61 Gatherer.println("First path component matches root node.");62 DebugStream.println("First path component matches root node."); 62 63 // For each path with this tree path 63 64 for(int i = 1; current != null && i < path.getPathCount(); i++) { … … 68 69 stale_node = (FileNode) stale_object; 69 70 } 70 Gatherer.print("Searching for '" + stale_object + "': ");71 DebugStream.print("Searching for '" + stale_object + "': "); 71 72 // Locate the fresh node by searching current's children. Remember to ensure that current is mapped. 72 73 //current.unmap(); … … 76 77 for(int j = 0; !found && j < current.getChildCount(); j++) { 77 78 FileNode child_node = (FileNode) current.getChildAt(j); 78 Gatherer.print(child_node + " ");79 DebugStream.print(child_node + " "); 79 80 if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) { 80 81 found = true; 81 82 current = child_node; 82 Gatherer.println("Found!");83 DebugStream.println("Found!"); 83 84 } 84 85 child_node = null; … … 87 88 for(int j = 0; !found && j < current.size(); j++) { 88 89 FileNode child_node = (FileNode) current.get(j); 89 Gatherer.print(child_node + " ");90 DebugStream.print(child_node + " "); 90 91 if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) { 91 92 found = true; 92 93 current = child_node; 93 Gatherer.println("Found!");94 DebugStream.println("Found!"); 94 95 } 95 96 child_node = null; … … 98 99 if(!found) { 99 100 current = null; 100 Gatherer.println("Not Found!");101 DebugStream.println("Not Found!"); 101 102 } 102 103 else { 103 Gatherer.println("Returning node: " + new TreePath(current.getPath()));104 DebugStream.println("Returning node: " + new TreePath(current.getPath())); 104 105 } 105 106 // Repeat as necessary -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
r7639 r8236 2 2 3 3 import javax.swing.tree.TreePath; 4 import org.greenstone.gatherer.DebugStream; 4 5 import org.greenstone.gatherer.Gatherer; 5 6 import org.greenstone.gatherer.collection.CollectionManager; … … 79 80 for (int i = 0; i < old_folder_shortcuts.length; i++) { 80 81 if (!doesArrayContain(folder_shortcuts, old_folder_shortcuts[i])) { 81 Gatherer.println("Deleted shortcut: " + old_folder_shortcuts[i]);82 DebugStream.println("Deleted shortcut: " + old_folder_shortcuts[i]); 82 83 SynchronizedTreeModelTools.removeNodeFromParent(workspace_tree_model, 83 84 old_folder_shortcuts[i]); … … 90 91 for (int i = 0; i < folder_shortcuts.length; i++) { 91 92 if (!doesArrayContain(old_folder_shortcuts, folder_shortcuts[i])) { 92 Gatherer.println("Added shortcut: " + folder_shortcuts[i]);93 DebugStream.println("Added shortcut: " + folder_shortcuts[i]); 93 94 SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model, workspace_tree_root, folder_shortcuts[i], false); 94 95 }
Note:
See TracChangeset
for help on using the changeset viewer.