com.mucommander.job
Class MoveJob

java.lang.Object
  extended by com.mucommander.job.FileJob
      extended by com.mucommander.job.TransferFileJob
          extended by com.mucommander.job.AbstractCopyJob
              extended by com.mucommander.job.MoveJob
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
BatchRenameJob

public class MoveJob
extends AbstractCopyJob

This job recursively moves a group of files.

Author:
Maxence Bernard

Field Summary
protected  boolean renameMode
          True if this job corresponds to a single file renaming
 
Fields inherited from class com.mucommander.job.AbstractCopyJob
append, archiveToOptimize, baseDestFolder, defaultFileExistsAction, errorDialogTitle, isOptimizingArchive, newName
 
Fields inherited from class com.mucommander.job.FileJob
APPEND_ACTION, APPEND_TEXT, baseSourceFolder, CANCEL_ACTION, CANCEL_TEXT, currentFile, currentFileIndex, currentFilename, files, FINISHED, INTERRUPTED, mainFrame, nbFiles, NOT_STARTED, PAUSED, progressDialog, RETRY_ACTION, RETRY_TEXT, RUNNING, SKIP_ACTION, SKIP_TEXT
 
Constructor Summary
MoveJob(ProgressDialog progressDialog, MainFrame mainFrame, FileSet files, AbstractFile destFolder, java.lang.String newName, int fileExistsAction, boolean renameMode)
          Creates a new MoveJob without starting it.
 
Method Summary
 java.lang.String getStatusString()
          This method is overridden to return a custom string "Checking integrity of CURRENT_FILE" when the current file is being checked for integrity.
protected  boolean hasFolderChanged(AbstractFile folder)
          Returns true if the given folder has or may have been modified by this job.
protected  void jobCompleted()
          This method is called when this job has completed normal execution : all files have been processed without any interruption (without any call to FileJob.interrupt()).
protected  boolean processFile(AbstractFile file, java.lang.Object recurseParams)
          Moves recursively the given file or folder.
 
Methods inherited from class com.mucommander.job.AbstractCopyJob
checkForCollision, createDestinationFile, optimizeArchive
 
Methods inherited from class com.mucommander.job.TransferFileJob
closeCurrentInputStream, copyFile, getCurrentFileByteCounter, getCurrentFileSize, getCurrentFileSkippedByteCounter, getFilePercentDone, getThroughputLimit, getTotalByteCounter, getTotalPercentDone, getTotalSkippedByteCounter, isCheckingIntegrity, isIntegrityCheckEnabled, jobPaused, jobResumed, jobStopped, nextFile, setCurrentInputStream, setIntegrityCheckEnabled, setThroughputLimit, skipCurrentFile, tryCopyFile, wasCurrentFileSkipped
 
Methods inherited from class com.mucommander.job.FileJob
addFileJobListener, getCurrentFileIndex, getCurrentFilename, getEffectiveJobTime, getEndDate, getNbFiles, getPausedTime, getPauseStartDate, getStartDate, getState, interrupt, jobStarted, refreshTables, removeFileJobListener, run, selectFileWhenFinished, setAutoUnmark, setPaused, setState, showErrorDialog, showErrorDialog, start, waitForUserResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renameMode

protected boolean renameMode
True if this job corresponds to a single file renaming

Constructor Detail

MoveJob

public MoveJob(ProgressDialog progressDialog,
               MainFrame mainFrame,
               FileSet files,
               AbstractFile destFolder,
               java.lang.String newName,
               int fileExistsAction,
               boolean renameMode)
Creates a new MoveJob without starting it.

Parameters:
progressDialog - dialog which shows this job's progress
mainFrame - mainFrame this job has been triggered by
files - files which are going to be moved
destFolder - destination folder where the files will be moved
newName - the new filename in the destination folder, can be null in which case the original filename will be used.
fileExistsAction - default action to be performed when a file already exists in the destination, see FileCollisionDialog for allowed values
renameMode - true if this job corresponds to a single file renaming
Method Detail

processFile

protected boolean processFile(AbstractFile file,
                              java.lang.Object recurseParams)
Moves recursively the given file or folder.

Specified by:
processFile in class FileJob
Parameters:
file - the file or folder to move
recurseParams - destination folder where the given file will be moved (null for top level files)
Returns:
true if the file has been moved completly (copied + deleted).

hasFolderChanged

protected boolean hasFolderChanged(AbstractFile folder)
Description copied from class: FileJob
Returns true if the given folder has or may have been modified by this job. This method is called after this job has finished processing files, to determine if the current MainFrame's file tables need to be refreshed to reveal the modified contents.

Specified by:
hasFolderChanged in class FileJob
Parameters:
folder - the folder to test
Returns:
true if the given folder has or may have been modified by this job

jobCompleted

protected void jobCompleted()
Description copied from class: FileJob
This method is called when this job has completed normal execution : all files have been processed without any interruption (without any call to FileJob.interrupt()).

The call happens after the last call to FileJob.processFile(AbstractFile,Object) is made. This method implementation does nothing but it can be overriden by subclasses to properly complete the job.

Note that this method will NOT be called if a call to FileJob.interrupt() was made before all files were processed.

Overrides:
jobCompleted in class FileJob

getStatusString

public java.lang.String getStatusString()
Description copied from class: TransferFileJob
This method is overridden to return a custom string "Checking integrity of CURRENT_FILE" when the current file is being checked for integrity.

Overrides:
getStatusString in class TransferFileJob
Returns:
a String describing what the job is currently doing


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard