- Timestamp:
- 2004-11-18T12:06:13+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r8595 r8596 445 445 // If we haven't been cancelled, and we've been asked to delete a directory/file, or perhaps as part of a move, we delete the file. This involves removing any existing metadata and then copying the file to the recycled bin (for a delete only), then deleting the file. When deleting a directory record from the tree (or from the filesystem for that matter) we must ensure that all of the descendant records have already been removed. If we fail to do this the delete will fail, or you will be bombarded with hundreds of 'Parent node of null not allowed' error messages. Also be aware that if the user has cancelled just this action, because of say a name clash, then we shouldn't do any deleting of any sort dammit. 446 446 if(!cancel_action && ready && (job.type == FileJob.DELETE || job.type == FileJob.MOVE)) { 447 ///atherer.println("Delete/Move: " + origin_node); 448 ///atherer.println(queue.size() + " jobs remain in queue"); 449 447 // Update the progress bar for this job 450 448 if (source_file.isFile()) { 451 449 progress.addValue(source_file.length()); … … 455 453 File[] child_list = source_file.listFiles(); 456 454 if (source_file.isFile() || (child_list != null && child_list.length == 0 && origin_node.getParent() != null)) { 457 // System.err.println("Deleting file: " + source_file.getAbsolutePath());458 459 455 // Update status area 460 456 String args[] = new String[1]; … … 485 481 // Else the source is a directory and it has children remaining 486 482 else if(child_list != null && child_list.length > 0) { 487 FileNode recycle_folder_record = null;488 483 // Don't worry about all this for true file move actions. 489 484 if(job.type == FileJob.DELETE) { … … 512 507 target_file = null; 513 508 origin_node = null; 514 // We can only break out of the while loop if we are out of files, or if the action was cancelled. 515 if(cancel_action) { 509 510 // We only break out of the while loop if we are out of files or the action was cancelled 511 if (cancel_action) { 516 512 // Empty queue 517 513 clearJobs(); 518 514 cancel_action = false; 519 515 } 520 // Debugging pause.521 ///ystem.err.println("Job complete.");522 516 } 523 517 else { 524 518 // Disable stop button 525 if (stop_button != null) {519 if (stop_button != null) { 526 520 stop_button.setEnabled(false); 527 521 } … … 547 541 } 548 542 } 549 543 544 550 545 /** Register the button that will be responsible for stopping executing file actions. 551 546 * @param stop_button a JButton
Note:
See TracChangeset
for help on using the changeset viewer.