Changeset 22454

Show
Ignore:
Timestamp:
20.07.2010 17:01:04 (9 years ago)
Author:
ak19
Message:

3rd commit to do with getting Remote GLI to work with colgroups: changes to GLI code to adjust for instances where the collection group and tail names need to be carefully used to get the zip file path and zip file name right.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
3 modified

Legend:

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

    r22410 r22454  
    12061206    File collection_file = new File(location); 
    12071207 
     1208    //String collection_name = collection_directory.getName(); 
     1209    String collection_name = "";         
    12081210    File collection_directory = collection_file.getParentFile(); 
    1209     String collection_name = collection_directory.getName(); 
     1211 
     1212    // To get colname = (colgroup/)coltailname, subtract Gatherer.getCollectDirectoryPath() from collection_directory: 
     1213    int index = collection_directory.getAbsolutePath().indexOf(Gatherer.getCollectDirectoryPath());  
     1214    if(index == -1) { 
     1215        System.err.println("*** ERROR: collection directory " + collection_directory + " is not located in collect folder: " + Gatherer.getCollectDirectoryPath()); 
     1216    } else { 
     1217        index += Gatherer.getCollectDirectoryPath().length();        
     1218        collection_name = collection_directory.getAbsolutePath().substring(index); 
     1219    } 
    12101220 
    12111221    if (Gatherer.isGsdlRemote) { 
  • main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServerAction.java

    r22410 r22454  
    350350        download_collection_file_command += "&file=" + URLEncoder.encode(collection_file_relative_path, "UTF-8"); 
    351351        download_collection_file_command += "&lr=" + remote.lang_region; 
    352         String zip_file_name = collection_name + "-" + collection_file.getName() + ".zip"; 
    353         String zip_file_path = collection_directory_path + zip_file_name; 
     352 
     353        // String zip_file_name = collection_name + "-" + collection_file.getName() + ".zip"; 
     354        // String zip_file_path = collection_directory_path + zip_file_name;         
     355        String zip_file_path = Gatherer.getCollectDirectoryPath() + collection_name + "-" + collection_file.getName() + ".zip"; // collect/(colgroup/)coltail/colfile.zip 
    354356        action_output = remote.downloadFile(download_collection_file_command, zip_file_path); 
    355357 
     
    582584 
    583585        // Zip up the files to send to the server 
    584         String zip_file_name = collection_name + "-" + System.currentTimeMillis() + ".zip"; 
    585         String zip_file_path = collection_directory_path + zip_file_name; 
     586        //String zip_file_name = collection_name + "-" + System.currentTimeMillis() + ".zip"; 
     587            //String zip_file_path = collection_directory_path + zip_file_name; 
     588        String zip_file_path = collection_directory_path; // collect/(colgroup/)coltail/ 
     589        String zip_file_name = new File(zip_file_path).getName() + "-" + System.currentTimeMillis() + ".zip"; // <collection_tail_name>-<time>.zip 
     590        zip_file_path += zip_file_name; // collect/(colgroup/)coltail/coltail-time.zip 
    586591        ZipTools.zipFiles(zip_file_path, collection_directory_path, collection_file_relative_paths); 
    587592         
     
    628633        progress_bar.setAction("Uploading files into collection..."); 
    629634        
    630         String zip_file_name = collection_name + "-" + System.currentTimeMillis() + ".zip"; 
    631         String zip_file_path = Gatherer.getCollectDirectoryPath() + zip_file_name; 
     635        //String zip_file_name = collection_name + "-" + System.currentTimeMillis() + ".zip"; 
     636        //String zip_file_path = Gatherer.getCollectDirectoryPath() + zip_file_name; 
     637        String zip_file_path = Gatherer.getCollectDirectoryPath()  
     638        + collection_name + "-" + System.currentTimeMillis() + ".zip"; // "collect/(colgroup/)collection_tail_name-<time>.zip" 
     639        String zip_file_name = new File(zip_file_path).getName(); // "collection_tail_name-<time>.zip" 
    632640        DebugStream.println("Zip file path: " + zip_file_path); 
    633641 
  • main/trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r18589 r22454  
    524524    } 
    525525 
    526     /** Method for firing a process begun event which is called, strangly enough, when the process begins. 
     526    /** Method for firing a process begun event which is called, strangely enough, when the process begins. 
    527527     * @param type An <strong>int</strong> indicating the process type. 
    528528     * @param status An <strong>int</strong> specifying the current status of the process.