Changeset 36237


Ignore:
Timestamp:
2022-06-03T17:30:55+12:00 (5 weeks ago)
Author:
davidb
Message:

Bugfix: Fixing my own bug (Anu). When replacing a file with another file in the Gather Pane through the Replace task in the popup menu, I missed handling the remote case for if the new file has a different name from the old file. The solution was simple, in that in this case too, the ReplaceTask instance must listen out for the File Copied Success event getting fired, so that it can then upload the new file to the remote machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/file/FileManager.java

    r34288 r36237  
    577577        file_queue.addJob(System.currentTimeMillis(), Gatherer.g_man.gather_pane.workspace_tree, new FileNode[] { source_node }, collection_tree, parent, FileJob.COPY);
    578578       
    579         } else {
    580         // If the file name of the replacing file is NOT the same as the one being replaced
    581         // (a) copy the new file in - but don't bring metadata
     579        } else {       
     580        // If the file name of the replacing file is NOT the same as the one being replaced:
     581        // (a) Again, this ReplaceTask instance needs to listen for the file copy event fired,
     582        // so that the source file will also get uploaded to the remote GS3 on FileCopiedSuccess
     583        file_queue.addFileCopiedSuccessListener(this);
     584
     585        // (b) copy the new file in - but don't bring metadata
    582586        file_queue.addJob(System.currentTimeMillis(), Gatherer.g_man.gather_pane.workspace_tree, new FileNode[] { source_node }, collection_tree, parent, FileJob.COPY_FILE_ONLY);
    583587       
    584         // (b) final step to finish off: do a replace of old file with new file
     588        // (c) final step to finish off: do a replace of old file with new file
    585589        file_queue.addJob(System.currentTimeMillis(), collection_tree, new FileNode[] { collection_tree_node }, collection_tree, new_collection_tree_node, FileJob.REPLACE);
    586590        }
Note: See TracChangeset for help on using the changeset viewer.