Changeset 11242 for trunk/gli/src/org
- Timestamp:
- 2006-02-14T14:58:24+13:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/file
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileJob.java
r11241 r11242 60 60 /** An element of the job type enumeration indicating an empty folder delete action. */ 61 61 static final public byte DELETE_EMPTY_DIRECTORY = 5; 62 /** An element of the job type enumeration indicating a rename action. */ 63 static final public byte RENAME = 6; 62 64 63 65 /** Constructor. -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r11241 r11242 312 312 File source_directory = source_node.getFile(); 313 313 File target_directory = new File(target_node.getFile(), source_directory.getName()); 314 if (file_job.type == FileJob.RENAME) { 315 // This is the only difference between moves and renames 316 target_directory = target_node.getFile(); 317 target_node = (FileNode) source_node.getParent(); 318 } 314 319 315 320 // Check the target directory isn't the source directory … … 486 491 File source_file = source_node.getFile(); 487 492 File target_file = new File(target_node.getFile(), source_file.getName()); 493 if (file_job.type == FileJob.RENAME) { 494 // This is the only difference between moves and renames 495 target_file = target_node.getFile(); 496 target_node = (FileNode) source_node.getParent(); 497 } 488 498 489 499 // Check the target file isn't the source file … … 580 590 } 581 591 582 // Move job583 if (file_job.type == FileJob.MOVE ) {592 // Move (or rename) job 593 if (file_job.type == FileJob.MOVE || file_job.type == FileJob.RENAME) { 584 594 file_status.setText(Dictionary.get("FileActions.Moving", formatPath("FileActions.Moving", source_file.getAbsolutePath(), file_status.getSize().width))); 585 595 if (source_file.isFile()) {
Note:
See TracChangeset
for help on using the changeset viewer.