Changeset 4799


Ignore:
Timestamp:
2003-06-25T13:54:46+12:00 (21 years ago)
Author:
jmt12
Message:

bug#2030155: Moved greenstone collection mapping into FileNode

File:
1 edited

Legend:

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

    r4686 r4799  
    625625        current_collection_directory = Utility.getCollectionDir(Gatherer.config.gsdl_path) + collection.getName();
    626626    }
    627 
    628627    // Create the workspace tree.
    629628    FileNode workspace_root = new FileNode("ABS_ROOT");
     
    631630    // Create and add Greenstone collections node.
    632631    // Starting at the collection directory of gsdl...
    633     File start = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path));
    634632    FileNode world_root = new FileNode(get("Tree.World"));
     633    world_root.unmap();
    635634    workspace_root.insert(world_root);
    636     // For each of the children directories, which are collections...
    637     File cols[] = start.listFiles();
    638     ArrayTools.sort(cols);
    639     // We add their import and gimport directories, but only if its not our current collection.
    640     for(int i = 0; cols != null && i < cols.length; i++) {
    641         ///ystem.err.print("Collection: " + collection);
    642         ///ystem.err.print(" Current collection dir: " + current_collection_directory);
    643         ///ystem.err.print(" Col " + i + " : " + cols[i] + "\n");
    644         if(collection == null || (!current_collection_directory.equals(cols[i].getAbsolutePath()) && !cols[i].getName().equals("modelcol"))) {
    645         File dirs[] = cols[i].listFiles();
    646         ArrayTools.sort(dirs);
    647         File import_dir = new File(cols[i], "gimport");
    648         if(!import_dir.exists()) {
    649             import_dir = new File(cols[i], "import");
    650         }
    651         if(import_dir.exists()) {
    652             FileNode collection_root = new FileNode(import_dir, cols[i].getName(), true);
    653             world_root.insert(collection_root);
    654             collection_root = null;
    655         }
    656         import_dir = null;
    657         }
    658     }
    659635    // Create Local File space.
    660636    // Get all the available roots mounted on the system.
Note: See TracChangeset for help on using the changeset viewer.