Changeset 10345


Ignore:
Timestamp:
2005-07-28T16:19:40+12:00 (19 years ago)
Author:
mdewsnip
Message:

Removed some more crap out of the Utility class.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
28 edited

Legend:

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

    r10342 r10345  
    4545import javax.swing.plaf.*;
    4646import org.greenstone.gatherer.util.StaticStrings;
    47 import org.greenstone.gatherer.util.Utility;
    4847import org.greenstone.gatherer.util.XMLTools;
    4948import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r9349 r10345  
    4444import javax.swing.text.*;
    4545import javax.swing.tree.*;
    46 import org.greenstone.gatherer.util.Utility;
    4746
    4847/** Extends the ResourceBundle class to allow for the automatic insertion of arguments.<BR>
  • trunk/gli/src/org/greenstone/gatherer/cdm/Argument.java

    r9126 r10345  
    4242import org.greenstone.gatherer.metadata.MetadataTools;
    4343import org.greenstone.gatherer.util.StaticStrings;
    44 import org.greenstone.gatherer.util.Utility;
    4544import org.greenstone.gatherer.util.XMLTools;
    4645import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r10332 r10345  
    3737import org.greenstone.gatherer.gui.GLIButton;
    3838import org.greenstone.gatherer.metadata.MetadataElement;
     39import org.greenstone.gatherer.metadata.MetadataSetManager;
    3940import org.greenstone.gatherer.metadata.MetadataTools;
    4041import org.greenstone.gatherer.util.DOMTree;
    4142import org.greenstone.gatherer.util.Codec;
    4243import org.greenstone.gatherer.util.StaticStrings;
    43 import org.greenstone.gatherer.util.Utility;
    4444import org.greenstone.gatherer.util.XMLTools;
    4545import org.w3c.dom.*;
     
    594594        // Remove any references to a namespace for extracted metadata
    595595        if (!show_extracted_namespace) {
    596         String match_string = "\\[" + Utility.EXTRACTED_METADATA_NAMESPACE + "\\.";
     596        String match_string = "\\[" + MetadataSetManager.EXTRACTED_METADATA_NAMESPACE + "\\.";
    597597        value_str = value_str.replaceAll(match_string, "[");
    598598        }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java

    r8243 r10345  
    3030import org.greenstone.gatherer.util.Codec;
    3131import org.greenstone.gatherer.util.StaticStrings;
    32 import org.greenstone.gatherer.util.Utility;
    3332import org.greenstone.gatherer.util.XMLTools;
    3433import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r8243 r10345  
    3636import org.greenstone.gatherer.Gatherer;
    3737import org.greenstone.gatherer.util.StaticStrings;
    38 import org.greenstone.gatherer.util.Utility;
    3938import org.w3c.dom.*;
    4039
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r10341 r10345  
    4141import org.greenstone.gatherer.metadata.MetadataSetManager;
    4242import org.greenstone.gatherer.util.StaticStrings;
    43 import org.greenstone.gatherer.util.Utility;
    4443import org.w3c.dom.*;
    4544
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r10237 r10345  
    4545import org.greenstone.gatherer.gui.WarningDialog;
    4646import org.greenstone.gatherer.util.StaticStrings;
    47 import org.greenstone.gatherer.util.Utility;
    4847
    4948/** This class is responsible for generating the necessary GUI components. It does this by calling the getEditControls() method of the appropriate class (i.e. IndexManager for index related edits). It also is in charge of correctly adding (and removing) listeners, using phrases from the <strong>Dictionary</strong> rather than the text keys inserted in the component classes, and several other aspects of the design page, including the config file section tree.
  • trunk/gli/src/org/greenstone/gatherer/cdm/Index.java

    r9995 r10345  
    3535import org.greenstone.gatherer.metadata.MetadataTools;
    3636import org.greenstone.gatherer.util.StaticStrings;
    37 import org.greenstone.gatherer.util.Utility;
    3837import org.greenstone.gatherer.util.XMLTools;
    3938import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java

    r10342 r10345  
    4545import org.greenstone.gatherer.metadata.MetadataTools;
    4646import org.greenstone.gatherer.metadata.MetadataXMLFileManager;
    47 import org.greenstone.gatherer.util.Utility;
    4847
    4948
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java

    r9161 r10345  
    3030import org.greenstone.gatherer.DebugStream;
    3131import org.greenstone.gatherer.util.StaticStrings;
    32 import org.greenstone.gatherer.util.Utility;
    3332import org.greenstone.gatherer.util.XMLTools;
    3433import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r10237 r10345  
    4242import org.greenstone.gatherer.metadata.MetadataSetManager;
    4343import org.greenstone.gatherer.util.StaticStrings;
    44 import org.greenstone.gatherer.util.Utility;
    4544import org.w3c.dom.*;
    4645
  • trunk/gli/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java

    r8247 r10345  
    4343import org.greenstone.gatherer.util.Codec;
    4444import org.greenstone.gatherer.util.StaticStrings;
    45 import org.greenstone.gatherer.util.Utility;
    4645import org.w3c.dom.*;
    4746
  • trunk/gli/src/org/greenstone/gatherer/collection/Collection.java

    r10237 r10345  
    4848import org.greenstone.gatherer.cdm.CollectionMetaManager;
    4949import org.greenstone.gatherer.util.StaticStrings;
    50 import org.greenstone.gatherer.util.Utility;
    5150import org.greenstone.gatherer.util.XMLTools;
    5251import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r10342 r10345  
    173173    if(collection != null) {
    174174        // Determine if the collection has been built by looking for the build.cfg file
    175         File build_cfg_file = new File(getCollectionIndexDirectoryPath() + Utility.BUILD_CFG_FILENAME);
     175        File build_cfg_file = new File(getCollectionIndexDirectoryPath() + "build.cfg");
    176176        return build_cfg_file.exists();
    177177    }
     
    395395        // Always import the extracted metadata set if we didn't already
    396396        if (MetadataSetManager.getMetadataSet(MetadataSetManager.EXTRACTED_METADATA_NAMESPACE) == null) {
    397         File extracted_metadata_set_file = new File(Gatherer.getGLIMetadataDirectoryPath() + Utility.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION);
     397        File extracted_metadata_set_file = new File(Gatherer.getGLIMetadataDirectoryPath() + MetadataSetManager.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION);
    398398        importMetadataSet(new MetadataSet(extracted_metadata_set_file));
    399399        }
     
    11461146
    11471147    // Always import the extracted metadata set
    1148     File extracted_metadata_set_file = new File(Gatherer.getGLIMetadataDirectoryPath() + Utility.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION);
     1148    File extracted_metadata_set_file = new File(Gatherer.getGLIMetadataDirectoryPath() + MetadataSetManager.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION);
    11491149    importMetadataSet(new MetadataSet(extracted_metadata_set_file));
    11501150
  • trunk/gli/src/org/greenstone/gatherer/file/FileSystem.java

    r10342 r10345  
    55import org.greenstone.gatherer.Dictionary;
    66import org.greenstone.gatherer.Gatherer;
    7 import org.greenstone.gatherer.util.Utility;
    87
    98
  • trunk/gli/src/org/greenstone/gatherer/file/RecycleBin.java

    r10342 r10345  
    5151import org.greenstone.gatherer.util.DragGroup;
    5252import org.greenstone.gatherer.util.JarTools;
    53 import org.greenstone.gatherer.util.Utility;
    5453
    5554
  • trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTree.java

    r9062 r10345  
    3434import org.greenstone.gatherer.Gatherer;
    3535import org.greenstone.gatherer.gui.tree.DragTree;
    36 import org.greenstone.gatherer.util.Utility;
    3736
    3837
  • trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java

    r10342 r10345  
    6666import org.greenstone.gatherer.util.Codec;
    6767import org.greenstone.gatherer.util.JarTools;
    68 import org.greenstone.gatherer.util.Utility;
    6968import org.greenstone.gatherer.util.XMLTools;
    7069import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/gems/GEMSLanguageManager.java

    r8971 r10345  
    5050import org.greenstone.gatherer.Gatherer;
    5151import org.greenstone.gatherer.gui.GLIButton;
    52 import org.greenstone.gatherer.util.Utility;
    5352import org.w3c.dom.*;
    5453
  • trunk/gli/src/org/greenstone/gatherer/gems/GEMSNode.java

    r8971 r10345  
    4646import org.greenstone.gatherer.Dictionary;
    4747import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
    48 import org.greenstone.gatherer.util.Utility;
    4948import org.w3c.dom.*;
    5049/**
  • trunk/gli/src/org/greenstone/gatherer/gems/MSMUtils.java

    r9301 r10345  
    3333import org.greenstone.gatherer.util.ArrayTools;
    3434import org.greenstone.gatherer.util.StaticStrings;
    35 import org.greenstone.gatherer.util.Utility;
    3635import org.greenstone.gatherer.util.XMLTools;
    3736import org.w3c.dom.*;
     
    308307    // If no root, or no namespace found, assume its extracted (at least then they can't edit it)
    309308    if(namespace == null || namespace.equals("")) {
    310         namespace = Utility.EXTRACTED_METADATA_NAMESPACE;
     309        namespace = MetadataSetManager.EXTRACTED_METADATA_NAMESPACE;
    311310    }
    312311    name_buffer.insert(0, NS_SEP);
  • trunk/gli/src/org/greenstone/gatherer/gems/MetadataSet.java

    r10006 r10345  
    4545import org.greenstone.gatherer.Dictionary;
    4646import org.greenstone.gatherer.util.StaticStrings;
    47 import org.greenstone.gatherer.util.Utility;
    4847import org.greenstone.gatherer.util.XMLTools;
    4948import org.w3c.dom.*;
     
    469468    String namespace = root.getAttribute("namespace");
    470469    if(namespace == null || namespace.equals("")) {
    471         namespace = Utility.EXTRACTED_METADATA_NAMESPACE;
     470        namespace = MetadataSetManager.EXTRACTED_METADATA_NAMESPACE;
    472471    }
    473472    name = name + " (" + namespace + ")";
  • trunk/gli/src/org/greenstone/gatherer/gems/MetadataSetManager.java

    r10342 r10345  
    5858 * @version 2.3b
    5959 */
    60 public class MetadataSetManager {
     60public class MetadataSetManager
     61{
     62    static public final String EXTRACTED_METADATA_NAMESPACE = "ex";
     63
    6164    static final public String HIDDEN = "hidden"; //The name of the hidden, or system, metadata set.
    6265    static final public int MAX_LOADED_SETS = 64;
     
    150153    for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) {
    151154        MetadataSet mds = (MetadataSet)mds_hashtable.get(keys.nextElement());
    152         if((!mds.getNamespace().equals(Utility.EXTRACTED_METADATA_NAMESPACE) && !mds.getNamespace().equals(HIDDEN))
    153            || (mds.getNamespace().equals(Utility.EXTRACTED_METADATA_NAMESPACE) && (Configuration.get("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC) || force_extracted))
    154            || (mds.getNamespace().equals(Utility.EXTRACTED_METADATA_NAMESPACE) && mds.getNamespace().equals(HIDDEN) && all)) {
     155        if((!mds.getNamespace().equals(EXTRACTED_METADATA_NAMESPACE) && !mds.getNamespace().equals(HIDDEN))
     156           || (mds.getNamespace().equals(EXTRACTED_METADATA_NAMESPACE) && (Configuration.get("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC) || force_extracted))
     157           || (mds.getNamespace().equals(EXTRACTED_METADATA_NAMESPACE) && mds.getNamespace().equals(HIDDEN) && all)) {
    155158        ArrayList set_elements = mds.getElements();
    156159        ///ystem.err.println("The set " + mds + " has " + set_elements.getLength() + " elements.");
     
    222225    else if(!perfect) {
    223226        // No namespace so assume that its extracted metadata.
    224         set = (MetadataSet)mds_hashtable.get(Utility.EXTRACTED_METADATA_NAMESPACE);
     227        set = (MetadataSet)mds_hashtable.get(EXTRACTED_METADATA_NAMESPACE);
    225228        element = name;
    226229    }
     
    293296    for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) {
    294297        MetadataSet set = (MetadataSet)mds_hashtable.get(keys.nextElement());
    295         if(!set.getNamespace().equals(HIDDEN) && (include_greenstone_extracted || !set.getNamespace().equals(Utility.EXTRACTED_METADATA_NAMESPACE))) {
     298        if(!set.getNamespace().equals(HIDDEN) && (include_greenstone_extracted || !set.getNamespace().equals(EXTRACTED_METADATA_NAMESPACE))) {
    296299        result.add(set);
    297300        }
  • trunk/gli/src/org/greenstone/gatherer/gui/HelpFrame.java

    r10342 r10345  
    5050import org.greenstone.gatherer.util.JarTools;
    5151import org.greenstone.gatherer.util.StaticStrings;
    52 import org.greenstone.gatherer.util.Utility;
    5352import org.greenstone.gatherer.util.XMLTools;
    5453import org.w3c.dom.*;
  • trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java

    r10012 r10345  
    4545import org.greenstone.gatherer.Gatherer;
    4646import org.greenstone.gatherer.util.JarTools;
    47 import org.greenstone.gatherer.util.Utility;
    4847
    4948/** The menu bar for the Gatherer main GUI.
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionMetadataPrompt.java

    r10342 r10345  
    4141import org.greenstone.gatherer.util.CheckList;
    4242import org.greenstone.gatherer.util.CheckListEntry;
    43 import org.greenstone.gatherer.util.Utility;
    4443
    4544
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r10342 r10345  
    6565    /** The size of the io buffer, in bytes. */
    6666    static final public int BUFFER_SIZE = 1024;
    67     static final public String BUILD_CFG_FILENAME = "build.cfg";
    68     static final public String CFG_COLLECTIONMETA_COLLECTIONNAME = "collectionmeta\tcollectionname";
    69     static final public String CFG_COLLECTIONMETA_COLLECTIONEXTRA = "collectionmeta\tcollectionextra";
    70     static final public String CFG_COLLECTIONMETA_ICONCOLLECTION = "collectionmeta\ticoncollection";
    7167    static final public String CFG_CLASSIFY = "classify";
    7268    static final public String CFG_CLASSIFY_BUTTONNAME = "-buttonname";
     
    7470    static final public String CFG_CLASSIFY_METADATA = "-metadata";
    7571    static final public String CFG_CLASSIFY_SORT = "-sort";
    76     static final public String CFG_CREATOR = "creator";
    7772    static final public String CFG_FORMAT = "format";
    78     static final public String CFG_MAINTAINER = "maintainer";
    7973    static final public String COLLECTION_TREE = "Collection";
    8074    /** Definition of an important directory name, in this case the file the collection configuration is expect to be in. */
    8175    static final public String CONFIG_FILE = "etc" + File.separator + "collect.cfg";
    82     static final public String EXTRACTED_METADATA_NAMESPACE = "ex";
    83     /** The location of the default greenstone metadata file. */
    84     static final public String GREENSTONEDIRECTORYMETADATA_TEMPLATE = "xml/metadata.xml";
    8576    static final public String GLI_ARCHIVE = "GLI.jar";
    8677    static final public String GLI_EXTENSION = ".col";
Note: See TracChangeset for help on using the changeset viewer.