Changeset 7275


Ignore:
Timestamp:
2004-05-05T11:23:40+12:00 (20 years ago)
Author:
kjdon
Message:

renamed Utility.CONFIG_DIR to Utility.CONFIG_FILE cos it refers to the file, not the directory. Also getConfigDir renamed to getConfigFile

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

Legend:

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

    r7224 r7275  
    196196        for(int i = 0; possible_collections != null && i < possible_collections.length; i++) {
    197197        // The simpliest case is if the directory etc/collect.cfg file and a metadata/ in it. Thus it can easily be built upon.
    198         File collect_cfg_file = new File(possible_collections[i], Utility.CONFIG_DIR);
     198        File collect_cfg_file = new File(possible_collections[i], Utility.CONFIG_FILE);
    199199        if(collect_cfg_file.exists()) {
    200200            BasicCollectionConfiguration collect_cfg = new BasicCollectionConfiguration(collect_cfg_file);
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r7224 r7275  
    356356        // Now we update our collect.cfg
    357357        Gatherer.println("Copy and update collect.cfg from base collection.");
    358         updateCollectionCFG(new File(base_collection_directory, Utility.CONFIG_DIR), new File(a_dir, Utility.CONFIG_DIR), description, email, title);
     358        updateCollectionCFG(new File(base_collection_directory, Utility.CONFIG_FILE), new File(a_dir, Utility.CONFIG_FILE), description, email, title);
    359359        }
    360360
     
    512512     */
    513513    public String getCollectionConfig() {
    514     return Utility.getConfigDir(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName()));
     514    return Utility.getConfigFile(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getName()));
    515515    }
    516516
     
    840840        }
    841841
    842         collection.cdm = new CollectionDesignManager(new File(collection_file.getParent(), Utility.CONFIG_DIR));
     842        collection.cdm = new CollectionDesignManager(new File(collection_file.getParent(), Utility.CONFIG_FILE));
    843843        if (non_gatherer_collection) {
    844844        // We first recurse the Import folder tree, reading in any metadata.xml files, and then altering the non-namespaced element names to be valid GLI names
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r7224 r7275  
    283283            File import_dir = new File(cols[i], StaticStrings.IMPORT_FOLDER);
    284284            if(import_dir.exists()) {
    285                 BasicCollectionConfiguration collect_cfg = new BasicCollectionConfiguration(new File(cols[i], Utility.CONFIG_DIR));
     285                BasicCollectionConfiguration collect_cfg = new BasicCollectionConfiguration(new File(cols[i], Utility.CONFIG_FILE));
    286286                FileNode collection_root = new FileNode(import_dir, collect_cfg.toString(), true);
    287287                collection_root.setParent(this);
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java

    r7224 r7275  
    5555    for(int i = 0; children != null && i < children.length; i++) {
    5656        if(children[i].isDirectory()) {
    57         File config_file = new File(children[i], Utility.CONFIG_DIR);
     57        File config_file = new File(children[i], Utility.CONFIG_FILE);
    5858        if(current_config_file == null || !config_file.equals(current_config_file)) {
    5959            BasicCollectionConfiguration other_collection = new BasicCollectionConfiguration(config_file);
     
    108108    for (int i = 0; possible_collections != null && i < possible_collections.length; i++) {
    109109        // If the directory has a etc/collect.cfg file then it looks like a collection
    110         File collect_cfg_file = new File(possible_collections[i], Utility.CONFIG_DIR);
     110        File collect_cfg_file = new File(possible_collections[i], Utility.CONFIG_FILE);
    111111        if (collect_cfg_file.exists()) {
    112112        // If the directory has a metadata/ then the collection can be used as a base
  • trunk/gli/src/org/greenstone/gatherer/gui/OpenCollectionDialog.java

    r6051 r7275  
    169169        else {
    170170            // Build a wrapper around the collection configuration file.
    171             File config_file = new File(file.getParentFile(), Utility.CONFIG_DIR);
     171            File config_file = new File(file.getParentFile(), Utility.CONFIG_FILE);
    172172            if(config_file.exists()) {
    173173            BasicCollectionConfiguration collect_cfg = new BasicCollectionConfiguration(config_file);
     
    212212        File[] files = default_system_view.getFiles(dir, useFileHiding);
    213213        // Determine if the current dir actually contains a valid greenstone collection. To do this we check for the presence of the file <dir>/etc/collect.cfg and a directory named import.
    214         File collect_cfg_file = new File(dir, Utility.CONFIG_DIR);
     214        File collect_cfg_file = new File(dir, Utility.CONFIG_FILE);
    215215        File import_dir_file = new File(dir, Utility.IMPORT_DIR);
    216216        if(collect_cfg_file.exists() && import_dir_file.exists()) {
  • trunk/gli/src/org/greenstone/gatherer/gui/SimpleOpenCollectionDialog.java

    r6318 r7275  
    215215        String collection_foldername = collection_folder.getName();
    216216        if(!collection_folder.isFile() && !collection_foldername.equals(StaticStrings.MODEL_COLLECTION_NAME)) {
    217            BasicCollectionConfiguration collection_configuration = new BasicCollectionConfiguration(new File(collection_folder, Utility.CONFIG_DIR));
     217           BasicCollectionConfiguration collection_configuration = new BasicCollectionConfiguration(new File(collection_folder, Utility.CONFIG_FILE));
    218218           if(!collection_configuration.getName().equals(StaticStrings.ERROR_STR)) {
    219219              data.add(collection_configuration);
  • trunk/gli/src/org/greenstone/gatherer/mem/MEMNode.java

    r7224 r7275  
    160160            if(is_descendant) {
    161161                // Create a basic config class
    162                 BasicCollectionConfiguration config = new BasicCollectionConfiguration(new File(source_path, Utility.CONFIG_DIR));
     162                BasicCollectionConfiguration config = new BasicCollectionConfiguration(new File(source_path, Utility.CONFIG_FILE));
    163163                text = config.toString();
    164164                config = null;
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r7224 r7275  
    8989    static final public String COLLECTION_TREE = "Collection";
    9090    /** Definition of an important directory name, in this case the file the collection configuration is expect to be in. */
    91     static final public String CONFIG_DIR = "etc" + File.separator + "collect.cfg";
     91    static final public String CONFIG_FILE = "etc" + File.separator + "collect.cfg";
    9292    /** The default file name for the urls missing any file. */
    9393    static final public String DEFAULT_FILE = "index.html";
     
    505505     * @return The location of the given collections configuration file, also as a <strong>String</strong>.
    506506     */
    507     static public String getConfigDir(String col_dir) {
    508     return col_dir + CONFIG_DIR;
     507    static public String getConfigFile(String col_dir) {
     508    return col_dir + CONFIG_FILE;
    509509    }
    510510
Note: See TracChangeset for help on using the changeset viewer.