Changeset 4376


Ignore:
Timestamp:
2003-05-28T10:24:33+12:00 (21 years ago)
Author:
kjdon
Message:

when copying a file. use the filenode.toString() instead of file.getName(). this will use the filenodes title if available - needed when copying over collection directories. want the destination to have the collection name as shown in the source tree, rather than the actual directory name which is always import

File:
1 edited

Legend:

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

    r4366 r4376  
    217217            // Determine the target file for a copy or move.
    218218            if(job.type == FileJob.COPY || job.type == FileJob.MOVE) {
    219             target_file = new File(destination_node.getFile(), source_file.getName());
     219            //target_file = new File(destination_node.getFile(), source_file.getName());
     220            // use the name of the filenode instead of the name of the file - these should be the same except for the collection directories where we want the collection name to be used, not 'import' which is the underlying name
     221            target_file = new File(destination_node.getFile(), origin_node.toString());
    220222            }
    221223            // To copy a file, copy it then add any metadata found at the source. If this file was already in our collection then we must ensure the lastest version of its metadata.xml has been saved to disk. To copy a directory simply create the directory at the destination, then add all of its children files as new jobs.
Note: See TracChangeset for help on using the changeset viewer.