Changeset 11623 for trunk


Ignore:
Timestamp:
2006-04-07T13:28:27+12:00 (18 years ago)
Author:
mdewsnip
Message:

Removed some pointless static variables from Utility.

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

Legend:

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

    r11312 r11623  
    298298    try {
    299299        // do the macros dir
    300         File base_coll_macros = new File(base_coll_dir, Utility.MACROS_DIR);
     300        File base_coll_macros = new File(base_coll_dir, "macros");
    301301        if (base_coll_macros.isDirectory()) {
    302302        // copy all the macros over
    303         File new_coll_macros = new File(new_coll_dir, Utility.MACROS_DIR);
     303        File new_coll_macros = new File(new_coll_dir, "macros");
    304304        new_coll_macros.mkdirs();
    305305       
     
    851851
    852852    // Special case of a user trying to open an old greenstone collection.
    853     File collection_metadata_directory = new File(collection_directory, Utility.META_DIR);
     853    File collection_metadata_directory = new File(collection_directory, "metadata");
    854854    if (!collection_metadata_directory.exists()) {
    855855        DebugStream.println("Loading non-gatherer collection...");
     
    13821382        } // if collectionmeta
    13831383
    1384         if(command_type_str.equals(Utility.CFG_CLASSIFY)) {
     1384        if (command_type_str.equals("classify")) {
    13851385            StringBuffer text = new StringBuffer(command_type_str);
    13861386            // Read in the classifier command watching for hfile, metadata and sort arguments.
     
    13921392            while(tokenizer.hasMoreTokens()) {
    13931393            String token = tokenizer.nextToken();
    1394             if(token.equals(Utility.CFG_CLASSIFY_HFILE)) {
     1394            if (token.equals("-hfile")) {
    13951395                if(tokenizer.hasMoreTokens()) {
    13961396                text.append(" ");
     
    14001400                }
    14011401            }
    1402             else if(token.equals(Utility.CFG_CLASSIFY_METADATA)) {
     1402            else if (token.equals("-metadata")) {
    14031403                if(tokenizer.hasMoreTokens()) {
    14041404                text.append(" ");
     
    14181418                }
    14191419            }
    1420             else if(token.equals(Utility.CFG_CLASSIFY_SORT)) {
     1420            else if (token.equals("-sort")) {
    14211421                if(tokenizer.hasMoreTokens()) {
    14221422                text.append(" ");
     
    14341434                }
    14351435            }
    1436             else if(token.equals(Utility.CFG_CLASSIFY_BUTTONNAME)) {
     1436            else if(token.equals("-buttonname")) {
    14371437                buttonname = token;
    14381438            }
     
    14451445            if(old_metadata != null && new_metadata != null && buttonname == null) {
    14461446            text.append(' ');
    1447             text.append(Utility.CFG_CLASSIFY_BUTTONNAME);
     1447            text.append("-buttonname");
    14481448            text.append(' ');
    14491449            text.append(old_metadata);
     
    14721472            // There is still one special case, that of the format command. In such a command we have to search for [<target>] to ensure we don't change parts of the format which have nothing to do with the metadata elements.
    14731473            // we really want to build up the whole command here
    1474             boolean format_command = command_type_str.equals(Utility.CFG_FORMAT);
     1474            boolean format_command = command_type_str.equals("format");
    14751475            HashMap metadata_mapping = ProfileXMLFileManager.getMetadataMapping();
    14761476            if (metadata_mapping != null) {
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java

    r11391 r11623  
    280280        if (collect_cfg_file.exists()) {
    281281        // If the directory has a metadata/ then the collection can be used as a base
    282         File metadata_directory = new File(possible_collections[i], Utility.META_DIR);
     282        File metadata_directory = new File(possible_collections[i], "metadata");
    283283        if (metadata_directory.exists()) {
    284284            // Add to model
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r11622 r11623  
    5959    /** The size of the io buffer, in bytes. */
    6060    static final public int BUFFER_SIZE = 1024;
    61     static final public String CFG_CLASSIFY = "classify";
    62     static final public String CFG_CLASSIFY_BUTTONNAME = "-buttonname";
    63     static final public String CFG_CLASSIFY_HFILE = "-hfile";
    64     static final public String CFG_CLASSIFY_METADATA = "-metadata";
    65     static final public String CFG_CLASSIFY_SORT = "-sort";
    66     static final public String CFG_FORMAT = "format";
    6761    /** Definition of an important directory name, in this case the file the collection configuration is expect to be in. */
    6862    static final public String CONFIG_FILE = "etc" + File.separator + "collect.cfg";
     
    7165    /** Definition of an important directory name, in this case the import directory for the collection. */
    7266    static final public String IMPORT_DIR = "import" + File.separator;
    73     /** Definition of an important directory name, in this case the macros directory for the collection. */
    74     static final public String MACROS_DIR = "macros" + File.separator;
    75     /** Definition of an important directory name, in this case the location of the expected collection metadata sets.. */
    76     static final public String META_DIR = "metadata" + File.separator; // Col. Copy
    7767    /** The default name of the perl executable under unix. */
    7868    static final public String PERL_EXECUTABLE_UNIX = "perl";
Note: See TracChangeset for help on using the changeset viewer.