com.mucommander.job
Class TempCopyJob

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.CopyJob
                  extended by com.mucommander.job.TempCopyJob
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
TempExecJob, TempOpenWithJob

public class TempCopyJob
extends CopyJob

This job copies a file or a set of files to a temporary folder and makes the temporary file(s) read-only. The temporary files are deleted when the JVM terminates.

Author:
Maxence Bernard

Field Summary
protected  FileSet tempFiles
          This list is populated with temporary files, as they are created by processFile()
 
Fields inherited from class com.mucommander.job.CopyJob
COPY_MODE, currentDestFile, DOWNLOAD_MODE, UNPACK_MODE
 
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
TempCopyJob(ProgressDialog progressDialog, MainFrame mainFrame, AbstractFile fileToCopy)
          Creates a new TempExecJob that operates on a single file.
TempCopyJob(ProgressDialog progressDialog, MainFrame mainFrame, FileSet filesToCopy)
          Creates a new TempExecJob that operates on a single file.
 
Method Summary
protected static java.lang.String getTemporaryFileName(AbstractFile fileToExecute)
           
protected static AbstractFile getTemporaryFolder(FileSet filesToExecute)
           
protected  boolean processFile(AbstractFile file, java.lang.Object recurseParams)
          Copies recursively the given file or folder.
 
Methods inherited from class com.mucommander.job.CopyJob
getStatusString, hasFolderChanged, jobCompleted
 
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

tempFiles

protected FileSet tempFiles
This list is populated with temporary files, as they are created by processFile()

Constructor Detail

TempCopyJob

public TempCopyJob(ProgressDialog progressDialog,
                   MainFrame mainFrame,
                   AbstractFile fileToCopy)
Creates a new TempExecJob that operates on a single file.

Parameters:
progressDialog - the ProgressDialog that monitors this job
mainFrame - the MainFrame this job is attached to
fileToCopy - the file to copy to a temporary location

TempCopyJob

public TempCopyJob(ProgressDialog progressDialog,
                   MainFrame mainFrame,
                   FileSet filesToCopy)
Creates a new TempExecJob that operates on a single file.

Parameters:
progressDialog - the ProgressDialog that monitors this job
mainFrame - the MainFrame this job is attached to
filesToCopy - the file to copy to a temporary location
Method Detail

getTemporaryFolder

protected static AbstractFile getTemporaryFolder(FileSet filesToExecute)

getTemporaryFileName

protected static java.lang.String getTemporaryFileName(AbstractFile fileToExecute)

processFile

protected boolean processFile(AbstractFile file,
                              java.lang.Object recurseParams)
Description copied from class: CopyJob
Copies recursively the given file or folder.

Overrides:
processFile in class CopyJob
Parameters:
file - the file or folder to move
recurseParams - destination folder where the given file will be copied (null for top level files)
Returns:
true if the file has been copied.


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