Changeset 18948

Show
Ignore:
Timestamp:
14.04.2009 14:39:22 (10 years ago)
Author:
kjdon
Message:

getLoadedCollectionDirectoryPath now gets the path from the loaded collection, rather than from Gatherer's collect directory + coll name - it may be in a subdir in collect group. getCollectDirectory uses this path rather than the default. new method getDefaultCollectDirectory for teh old path, which commands that create new colls now use

Files:
1 modified

Legend:

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

    r18606 r18948  
    207207    command_parts_list.add(collection.getName()); 
    208208 
    209     // Run the buildcol.pl command 
     209    // Run the buildcol.pl and 
    210210    String[] command_parts = (String[]) command_parts_list.toArray(new String[0]); 
    211211    GShell shell = new GShell(command_parts, GShell.BUILD, BUILDING, this, build_monitor, GShell.GSHELL_BUILD); 
     
    507507    try { 
    508508        // first make sure that the collect directory exists 
    509         File collect_dir = new File(getCollectDirectory()); 
     509        File collect_dir = new File(getDefaultCollectDirectory()); 
    510510        if (!collect_dir.exists()) { 
    511511        collect_dir.mkdirs(); 
     
    837837    static public String getLoadedCollectionDirectoryPath() 
    838838    { 
    839     return Gatherer.getCollectDirectoryPath() + collection.getName() + File.separator; 
     839    return collection.getCollectionDirectory().getPath() + File.separator; 
    840840    } 
    841841 
     
    14031403 
    14041404    command_parts_list.add("-collectdir"); 
    1405     command_parts_list.add(getCollectDirectory()); 
     1405    command_parts_list.add(getDefaultCollectDirectory()); 
    14061406     
    14071407    command_parts_list.add("-win31compat"); 
     
    16851685    } 
    16861686 
    1687  
    1688     // used as arg in the perl scripts 
    1689     private String getCollectDirectory() { 
     1687    private String getDefaultCollectDirectory() { 
    16901688    String collect_dir = Gatherer.getCollectDirectoryPath(); 
    1691  
    16921689    // Remove erroneous file windows file separator as it causes problems when running import.pl 
    16931690    if(collect_dir.length() > 2 && collect_dir.endsWith("\\")) { 
    16941691        collect_dir = collect_dir.substring(0, collect_dir.length() - 1); 
    16951692    } 
    1696  
     1693    return collect_dir; 
     1694    } 
     1695 
     1696    // used as arg in the perl scripts 
     1697    private String getCollectDirectory() { 
     1698     
     1699    String collect_dir = collection.getCollectionDirectory().getParentFile().getPath(); 
    16971700    return collect_dir; 
    16981701    }