Ignore:
Timestamp:
2004-10-08T09:46:12+13:00 (20 years ago)
Author:
mdewsnip
Message:

Replaced all Gatherer.print* with DebugStream.print*.

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  
    3030import javax.swing.table.*;
    3131import org.greenstone.gatherer.Configuration;
     32import org.greenstone.gatherer.DebugStream;
    3233import org.greenstone.gatherer.Dictionary;
    3334import org.greenstone.gatherer.Gatherer;
     
    8081    }
    8182    else {
    82         Gatherer.println("Didn't parse anything. About to crash.");
     83        DebugStream.println("Didn't parse anything. About to crash.");
    8384    }
    8485    }
     
    9192
    9293    public String getBrowserCommand(String url) {
    93     Gatherer.println("Get browser command: " + url);
     94    DebugStream.println("Get browser command: " + url);
    9495    // First off we try to retrieve one from the configuration
    9596    String command = Configuration.getPreviewCommand();
     
    9798    if(command != null && command.length() > 0) {
    9899        command = command.replaceAll("%1", url);
    99         Gatherer.println("Result = " + command);
     100        DebugStream.println("Result = " + command);
    100101        return command;
    101102    }
     
    134135        Configuration.setPreviewCommand(command);
    135136        command = command.replaceAll(FILENAME_ARG, url);
    136         Gatherer.println("Result = " + command);
     137        DebugStream.println("Result = " + command);
    137138        return command;
    138139    }
    139140    // if we haven't got a command by now, we'll never get one
    140     Gatherer.println("Result = null");
     141    DebugStream.println("Result = null");
    141142    return null;
    142143   
     
    280281
    281282    public void setCommand(String extension, String command) {
    282     Gatherer.println("Set Launch: " + extension + " with " + command);
     283    DebugStream.println("Set Launch: " + extension + " with " + command);
    283284    // Retrieve any existing entry for this extension
    284285    Element entry = getCommand(extension);
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r8231 r8236  
    88import javax.swing.tree.*;
    99import org.greenstone.gatherer.Configuration;
     10import org.greenstone.gatherer.DebugStream;
    1011import org.greenstone.gatherer.Dictionary;
    1112import org.greenstone.gatherer.Gatherer;
     
    215216    /** Adds child to the receiver at index. */
    216217    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 + "]");
    218219    if (child == null) {
    219220        return;
     
    339340        if(files != null && files.length > 0) {
    340341            // Sort the remaining files.
    341             Gatherer.println("Number of files to sort: " + files.length);
     342            DebugStream.println("Number of files to sort: " + files.length);
    342343            ArrayTools.sort(files);
    343             Gatherer.println("Files sorted.");
     344            DebugStream.println("Files sorted.");
    344345            // Now add them to children.
    345346            raw_children = new ArrayList();
  • trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r8231 r8236  
    3333import javax.swing.tree.*;
    3434import org.greenstone.gatherer.Configuration;
     35import org.greenstone.gatherer.DebugStream;
    3536import org.greenstone.gatherer.Dictionary;
    3637import org.greenstone.gatherer.Gatherer;
     
    123124    FileJob job = new FileJob(id, source, child, target, parent, type, undo, undoable);
    124125    job.folder_level = folder_level;
    125         Gatherer.println("Adding job: " + job);
     126        DebugStream.println("Adding job: " + job);
    126127    if(position != -1 && position <= queue.size() + 1) {
    127128        queue.add(position, job);
     
    320321                    // 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.
    321322                    catch(FileNotFoundException fnf_exception) {
    322                     Gatherer.printStackTrace(fnf_exception);
     323                    DebugStream.printStackTrace(fnf_exception);
    323324                    cancel_action = true;
    324325                    // Show warning.
     
    328329                    }
    329330                    catch(FileAlreadyExistsException fae_exception) {
    330                     Gatherer.printStackTrace(fae_exception);
     331                    DebugStream.printStackTrace(fae_exception);
    331332                    cancel_action = true;
    332333                    // Show warning.
     
    335336                    }
    336337                    catch(InsufficientSpaceException is_exception) {
    337                     Gatherer.printStackTrace(is_exception);
     338                    DebugStream.printStackTrace(is_exception);
    338339                    cancel_action = true;
    339340                    // Show warning. The message body of the expection explains how much more space is required for this file copy.
     
    342343                    }
    343344                    catch(UnknownFileErrorException ufe_exception) {
    344                     Gatherer.printStackTrace(ufe_exception);
     345                    DebugStream.printStackTrace(ufe_exception);
    345346                    cancel_action = true;
    346347                    // Show warning
     
    349350                    }
    350351                    catch(WriteNotPermittedException wnp_exception) {
    351                     Gatherer.printStackTrace(wnp_exception);
     352                    DebugStream.printStackTrace(wnp_exception);
    352353                    cancel_action = true;
    353354                    // Show warning
     
    357358                    catch(IOException exception) {
    358359                    // Can't really do much about this.
    359                     Gatherer.printStackTrace(exception);
     360                    DebugStream.printStackTrace(exception);
    360361                    }
    361362                 // If not cancelled
     
    543544                }
    544545                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!!");
    546547                }
    547548            }
     
    595596        }
    596597        catch (Exception error) {
    597         Gatherer.printStackTrace(error);
     598        DebugStream.printStackTrace(error);
    598599        }
    599600    }
     
    675676        // Check if the origin file exists.
    676677        if(!source.exists()) {
    677         Gatherer.println("Couldn't find the source file.");
     678        DebugStream.println("Couldn't find the source file.");
    678679        throw(new FileNotFoundException());
    679680        }
  • trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java

    r7633 r8236  
    33import java.io.File;
    44import javax.swing.filechooser.FileSystemView;
     5import org.greenstone.gatherer.DebugStream;
    56import org.greenstone.gatherer.Dictionary;
    6 import org.greenstone.gatherer.Gatherer;
    77import org.greenstone.gatherer.file.FileNode;
    88import org.greenstone.gatherer.util.ArrayTools;
     
    5555
    5656    // 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);
    5858    String os_name_lc = os_name.toLowerCase();
    5959    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  
    66import javax.swing.event.*;
    77import javax.swing.tree.*;
     8import org.greenstone.gatherer.DebugStream;
    89import org.greenstone.gatherer.Dictionary;
    910import org.greenstone.gatherer.Gatherer;
     
    5960    FileNode first_node = (FileNode)path.getPathComponent(0);
    6061    if(current.equals(first_node)) {
    61         Gatherer.println("First path component matches root node.");
     62        DebugStream.println("First path component matches root node.");
    6263        // For each path with this tree path
    6364        for(int i = 1; current != null && i < path.getPathCount(); i++) {
     
    6869            stale_node = (FileNode) stale_object;
    6970        }
    70         Gatherer.print("Searching for '" + stale_object + "': ");
     71        DebugStream.print("Searching for '" + stale_object + "': ");
    7172        // Locate the fresh node by searching current's children. Remember to ensure that current is mapped.
    7273        //current.unmap();
     
    7677        for(int j = 0; !found && j < current.getChildCount(); j++) {
    7778            FileNode child_node = (FileNode) current.getChildAt(j);
    78             Gatherer.print(child_node + " ");
     79            DebugStream.print(child_node + " ");
    7980            if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) {
    8081            found = true;
    8182            current = child_node;
    82             Gatherer.println("Found!");
     83            DebugStream.println("Found!");
    8384            }
    8485            child_node = null;
     
    8788        for(int j = 0; !found && j < current.size(); j++) {
    8889            FileNode child_node = (FileNode) current.get(j);
    89             Gatherer.print(child_node + " ");
     90            DebugStream.print(child_node + " ");
    9091            if((stale_node != null && stale_node.equals(child_node)) || stale_object.toString().equals(child_node.toString())) {
    9192            found = true;
    9293            current = child_node;
    93             Gatherer.println("Found!");
     94            DebugStream.println("Found!");
    9495            }
    9596            child_node = null;
     
    9899        if(!found) {
    99100            current = null;
    100             Gatherer.println("Not Found!");
     101            DebugStream.println("Not Found!");
    101102        }
    102103        else {
    103             Gatherer.println("Returning node: " + new TreePath(current.getPath()));
     104            DebugStream.println("Returning node: " + new TreePath(current.getPath()));
    104105        }
    105106        // Repeat as necessary
  • trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java

    r7639 r8236  
    22
    33import javax.swing.tree.TreePath;
     4import org.greenstone.gatherer.DebugStream;
    45import org.greenstone.gatherer.Gatherer;
    56import org.greenstone.gatherer.collection.CollectionManager;
     
    7980        for (int i = 0; i < old_folder_shortcuts.length; i++) {
    8081        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]);
    8283            SynchronizedTreeModelTools.removeNodeFromParent(workspace_tree_model,
    8384                                    old_folder_shortcuts[i]);
     
    9091        for (int i = 0; i < folder_shortcuts.length; i++) {
    9192        if (!doesArrayContain(old_folder_shortcuts, folder_shortcuts[i])) {
    92             Gatherer.println("Added shortcut: " + folder_shortcuts[i]);
     93            DebugStream.println("Added shortcut: " + folder_shortcuts[i]);
    9394            SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model, workspace_tree_root, folder_shortcuts[i], false);
    9495        }
Note: See TracChangeset for help on using the changeset viewer.