Changeset 14307


Ignore:
Timestamp:
2007-08-06T10:38:11+12:00 (15 years ago)
Author:
qq6
Message:

zip collectionConfig.xml if parameter 'gsdl3' is found

File:
1 edited

Legend:

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

    r13328 r14307  
    1111    static public void main(String[] args)
    1212    {
    13     if (args.length != 3) {
    14         System.err.println("Usage: ZipCollectionShell <zip-file> <collect-directory-path> <collection-name>");
     13    if ((args.length < 3) || (args.length > 4)) {
     14        System.err.println("Usage: ZipCollectionShell <zip-file> <collect-directory-path> <collection-name> [gsdl3]");
    1515        return;
    1616    }
     
    1919    String collect_directory_path = args[1];
    2020    String collection_name = args[2];
    21 
     21    String run_gsdl3 ="";
     22    if (args.length == 4){
     23        run_gsdl3 = args[3];
     24    }
    2225    if (!collect_directory_path.endsWith(File.separator)) {
    2326        collect_directory_path += File.separator;
     
    3336        ZipTools.addFileToZip(zos, collect_directory_path, archives_relative_path, collection_archives_zip_filter);
    3437
    35         // Add etc/collect.cfg file
    36         String collect_cfg_relative_path = collection_name + File.separator + "etc" + File.separator + "collect.cfg";
    37         ZipTools.addFileToZip(zos, collect_directory_path, collect_cfg_relative_path, null_zip_filter);
    38 
     38        // Add /etc/collect.cfg file for 2 GS2
     39        if (run_gsdl3.length()==0){
     40        String collect_cfg_relative_path = collection_name + File.separator + "etc" + File.separator + "collect.cfg";
     41        ZipTools.addFileToZip(zos, collect_directory_path, collect_cfg_relative_path, null_zip_filter);
     42        }
     43        // Add /etc/collectConfig.xml file for a GS3
     44        if (run_gsdl3.equals("gsdl3")){
     45        String collectionConfig_xml_relative_path = collection_name + File.separator + "etc" + File.separator + "collectionConfig.xml";
     46        ZipTools.addFileToZip(zos, collect_directory_path, collectionConfig_xml_relative_path, null_zip_filter);
     47        }
    3948        // Add images directory
    4049        String images_relative_path = collection_name + File.separator + "images";
Note: See TracChangeset for help on using the changeset viewer.