Ignore:
Timestamp:
2003-11-05T13:46:44+13:00 (21 years ago)
Author:
mdewsnip
Message:

Commented out about 60 unused functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r5771 r5785  
    160160    /** The image for a toggle button whose state is 'off'. */
    161161    static final public ImageIcon OFF_ICON = new ImageIcon(ClassLoader.getSystemResource("images/cross.gif"));
    162     /** Method to turn a file from with the system file tree into a tree path for insertion into a tree.
    163      * @param file The <strong>File</strong> whose tree path you are attempting to discover.
    164      * @param in_col A <i>boolean</i> indicating whether we are looking for a file within a collection of not. If <i>true</i> then the tree paths head in the collection name, and no element in the path refers to the import directory. Otherwise the paths head will be one of the system roots and all traversed file locations will exist in the path.
    165      * @return A <strong>TreePath</strong> which traverses the file system tree to the specified file.
    166      */
    167     public static TreePath createTreePath(File file, boolean in_col) {
    168     TreePath path = null;
    169     // Get the absolute path of the file.
    170     String abs_path = file.getAbsolutePath();
    171     while(file != null) {
    172         // If we are looking for a node within our collection, we expect
    173         // its path from root to be <col_name>/... without any higher
    174         // details and without gimport. So if we encounter a gimport we
    175         // skip to its parent, add that, then return.
    176         if(in_col && file.getName().equals("gimport")) {
    177         file = file.getParentFile();
    178         if(path == null) {
    179             path = new TreePath(file.getName());
    180         }
    181         else {
    182             path = path.pathByAddingChild(file.getName());
    183         }
    184         file = null;
    185         }
    186         else {
    187         if(path == null) {
    188             path = new TreePath(file.getName());
    189         }
    190         else {
    191             path = path.pathByAddingChild(file.getName());
    192         }
    193         file = file.getParentFile();
    194         }
    195     }
    196     // Unfortunately we've created the path in reverse order so we have to
    197     // reverse it.
    198     Object temp[] = new Object[path.getPathCount()];
    199     for(int i = 0; i < temp.length; i++) {
    200         temp[(temp.length - 1) - i] = path.getPathComponent(i);
    201     }
    202     return new TreePath(temp);
    203     }
    204162
    205163    /** Decodes a string of text so its safe to use in a Greenstone configuration file. Esentially replaces "\n" with a newline.
     
    221179     * @return The decoded <strong>String</strong>.
    222180     */
    223     public static String decodeString(String encoded) {
     181    /* private static String decodeString(String encoded) {
    224182    String decoded = "";
    225183    for(int i = 0; i < encoded.length(); i++) {
     
    239197    }
    240198    return decoded;
    241     }
     199    } */
    242200    /** It turns out that in Java you have to make sure a directory is empty before you delete it (much like unix I suppose), and so just like unix I'll have to set up a recursive delete function.
    243201     * @param file The <strong>File</strong> you want to delete.
     
    260218    }
    261219
    262     static public String encodeGreenstone(String raw) {
     220    /* static private String encodeGreenstone(String raw) {
    263221    raw = raw.replaceAll("<", "&lt;");
    264222    raw = raw.replaceAll(">", "&gt;");
    265223    raw = raw.replaceAll("\n", "\\\\n");
    266224    return raw;
    267     }
     225    } */
    268226
    269227    /** Using this method we can request that a certain document be written, as valid XML, to a certain output stream. This makes use of the Xerces Serialization suite, which should in no way be confused with the usual method of Serialization used by Java. */
     
    578536     * @return A <strong>String</strong> representation of the mirroring depth padded to length characters.
    579537     */
    580     public static String getDepthString(int length) {
     538    /* private static String getDepthString(int length) {
    581539    return pad("" + Gatherer.self.config.getInt("mirroring.depth", false), length);
    582     }
     540    } */
    583541    /** Method which constructs the etc directory given a certain collection.
    584542     * @param col_dir The location of the collection directory as a <strong>String</strong>.
     
    646604
    647605
    648     static public File getRecycleDirectory() {
     606    /* static private File getRecycleDirectory() {
    649607    return new File(RECYCLE);
    650     }
     608    } */
    651609
    652610    /** Determine whether a character is a hexidecimal one.
     
    900858     * @return A filtered <strong>File[]</strong> containing only those drives that are accessible and/or are floppy-disk media drives.
    901859     */
    902     public static File[] validateDrives(File roots[]) {
     860    /* private static File[] validateDrives(File roots[]) {
    903861    Vector valid = new Vector();
    904862    for(int i = 0; i < roots.length; i++) {
     
    914872    }
    915873    return roots;
    916     }
     874    } */
    917875}
Note: See TracChangeset for help on using the changeset viewer.