com.mucommander.job
Class ArchiveJob

java.lang.Object
  extended by com.mucommander.job.FileJob
      extended by com.mucommander.job.TransferFileJob
          extended by com.mucommander.job.ArchiveJob
All Implemented Interfaces:
java.lang.Runnable

public class ArchiveJob
extends TransferFileJob

This FileJob is responsible for compressing a set of files into an archive file.

Author:
Maxence Bernard

Field Summary
 
Fields inherited from class com.mucommander.job.FileJob
APPEND_ACTION, APPEND_TEXT, baseSourceFolder, CANCEL_ACTION, CANCEL_TEXT, currentFile, currentFileIndex, currentFileInfo, files, FINISHED, INTERRUPTED, mainFrame, nbFiles, NOT_STARTED, PAUSED, progressDialog, RETRY_ACTION, RETRY_TEXT, RUNNING, SKIP_ACTION, SKIP_TEXT
 
Constructor Summary
ArchiveJob(ProgressDialog progressDialog, MainFrame mainFrame, FileSet files, AbstractFile destFile, int archiveFormat, java.lang.String archiveComment)
           
 
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 jobStarted()
          Overriden method to initialize the archiver and handle the case where the destination file already exists.
 void jobStopped()
          Overriden method to close the archiver.
protected  boolean processFile(AbstractFile file, java.lang.Object recurseParams)
          Automatically called by FileJob.run() for each file that needs to be processed.
 
Methods inherited from class com.mucommander.job.TransferFileJob
closeCurrentInputStream, copyFile, getCurrentFileByteCounter, getCurrentFileSize, getCurrentFileSkippedByteCounter, getFilePercentDone, getThroughputLimit, getTotalByteCounter, getTotalPercentDone, getTotalSkippedByteCounter, isCheckingIntegrity, isIntegrityCheckEnabled, jobPaused, jobResumed, nextFile, setCurrentInputStream, setIntegrityCheckEnabled, setThroughputLimit, skipCurrentFile, tryCopyFile, wasCurrentFileSkipped
 
Methods inherited from class com.mucommander.job.FileJob
addFileJobListener, getCurrentFileIndex, getCurrentFileInfo, getEffectiveJobTime, getEndDate, getNbFiles, getPausedTime, getPauseStartDate, getStartDate, getState, interrupt, jobCompleted, 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
 

Constructor Detail

ArchiveJob

public ArchiveJob(ProgressDialog progressDialog,
                  MainFrame mainFrame,
                  FileSet files,
                  AbstractFile destFile,
                  int archiveFormat,
                  java.lang.String archiveComment)
Method Detail

processFile

protected boolean processFile(AbstractFile file,
                              java.lang.Object recurseParams)
Description copied from class: FileJob
Automatically called by FileJob.run() for each file that needs to be processed.

Specified by:
processFile in class FileJob
Parameters:
file - the file or folder to process
recurseParams - array of parameters which can be used when calling this method recursively, contains null when called by FileJob.run()
Returns:
true if the operation was sucessful

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

jobStarted

protected void jobStarted()
Overriden method to initialize the archiver and handle the case where the destination file already exists.

Overrides:
jobStarted in class FileJob

jobStopped

public void jobStopped()
Overriden method to close the archiver.

Overrides:
jobStopped in class TransferFileJob

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