java.lang.Object
java.lang.Thread
eu.steffo.cleaver.logic.Job
eu.steffo.cleaver.logic.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 CompressConfig
compressConfig
private CryptConfig
cryptConfig
private File
resultFile
private SplitConfig
splitConfig
-
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 CompressConfig
getCompressConfig()
CryptConfig
getCryptConfig()
File
getFile()
SplitConfig
getSplitConfig()
String
getType()
protected static Document
openChp(File file)
protected void
parseChp(Document doc, String cryptKey)
void
run()
The function that is run on a different thread whenThread.start()
is called.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
-
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 shouldn't be thrown, but it isn't caught to allow its display in the GUI if it actually happens.
-
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 shouldn't be thrown, but it isn't caught to allow its display in the GUI if it actually happens.- 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 shouldn't be thrown, but it isn't caught to allow its display in the GUI if it actually happens.- See Also:
StitchJob(File, String)
,Job(Runnable)
-
-
Method Details
-
getType
-
getFile
-
getSplitConfig
- Specified by:
getSplitConfig
in classJob
- Returns:
- The
SplitConfig
of the job. If null, the job shouldn't handle file splitting/merging.
-
getCryptConfig
- Specified by:
getCryptConfig
in classJob
- Returns:
- The
CryptConfig
of the job. If null, the job shouldn't handle file encryption/decryption.
-
getCompressConfig
- Specified by:
getCompressConfig
in classJob
- Returns:
- The
CompressConfig
of the job. If null, the job shouldn't handle file compression/decompression.
-
openChp
- Throws:
ChpFileError
ProgrammingError
-
parseChp
- Parameters:
doc
- TheDocument
to be read.cryptKey
- The encryption key to use in theCryptConfig
.- Throws:
ChpFileError
- If there's an error while parsing the *.chp file.
-
run
public void run()Description copied from class:Job
The function that is run on a different thread whenThread.start()
is called. Child classes should overrideThread.run()
.
-