java.lang.Object
java.lang.Thread
eu.steffo.cleaver.logic.job.Job
eu.steffo.cleaver.logic.job.StitchJob
- All Implemented Interfaces:
Runnable
public class StitchJob extends Job
A
Job
that converts chopped (*.chp + *.cXX) files back into regular files.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields Modifier and Type Field Description private Document
chpDocument
private File
chpFolder
private String
cryptKey
private static int
UPDATE_EVERY_BYTES
-
Constructor Summary
Constructors Constructor Description StitchJob(File file)
Construct a StitchJob, specifying the *.chp file to import the settings from.StitchJob(File file, String cryptKey)
Construct a StitchJob, specifying the *.chp file to import the settings from and an encryption key to use while decrypting the files.StitchJob(File chpFile, String cryptKey, Runnable updateTable)
Construct a StitchJob, and additionally specify theRunnable
that should be called on progress updates. -
Method Summary
Modifier and Type Method Description protected static Document
getChpFileDocument(File chpFile)
Instantiate a newDocument
based on the contents of the passed file.String
getFileString()
String
getOperationsString()
File
getResultFile()
String
getTypeString()
void
run()
Methods inherited from class eu.steffo.cleaver.logic.job.Job
getProgress, getProgressString, setProgress
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, toString, yield
-
Field Details
-
cryptKey
-
chpFolder
-
chpDocument
-
UPDATE_EVERY_BYTES
private static final int UPDATE_EVERY_BYTES- See Also:
- Constant Field Values
-
-
Constructor Details
-
StitchJob
Construct a StitchJob, specifying the *.chp file to import the settings from.- Parameters:
file
- The *.chp file.- Throws:
ChpFileError
- If there's an error while parsing the *.chp file.ProgrammingError
- It should never be thrown, but it may happen if there's a bug in the program...
-
StitchJob
Construct a StitchJob, specifying the *.chp file to import the settings from and an encryption key to use while decrypting the files.- Parameters:
file
- The *.chp file.cryptKey
- The encryption key to use while decrypting the files.- Throws:
ChpFileError
- If there's an error while parsing the *.chp file.ProgrammingError
- It should never be thrown, but it may happen if there's a bug in the program...- See Also:
StitchJob(File)
-
StitchJob
public StitchJob(File chpFile, String cryptKey, Runnable updateTable) throws ChpFileError, ProgrammingErrorConstruct a StitchJob, and additionally specify theRunnable
that should be called on progress updates.- Parameters:
chpFile
- The *.chp file.cryptKey
- The encryption key to use while decrypting the files.updateTable
- TheRunnable
that should be invoked whenJob.setProgress(Progress)
is called.- Throws:
ChpFileError
- If there's an error while parsing the *.chp file.ProgrammingError
- It should never be thrown, but it may happen if there's a bug in the program...- See Also:
StitchJob(File, String)
,Job(Runnable)
-
-
Method Details
-
getTypeString
- Specified by:
getTypeString
in classJob
- Returns:
- The
String
that should be displayed in the Type column of theJobs Table
.
-
getResultFile
-
getFileString
- Specified by:
getFileString
in classJob
- Returns:
- The
String
that should be displayed in the File column of theJobs Table
.
-
getOperationsString
- Specified by:
getOperationsString
in classJob
- Returns:
- The
String
that should be displayed in the Operations column of theJobs Table
.
-
getChpFileDocument
Instantiate a newDocument
based on the contents of the passed file.- Parameters:
chpFile
- The file to create aDocument
from.- Returns:
- The created
Document
. - Throws:
ChpFileError
- If the .chp does not exist, or is corrupt.ProgrammingError
- It should never be thrown, but it may happen if there's a bug in the program...
-
run
public void run()
-