java.lang.Object
java.lang.Thread
eu.steffo.cleaver.logic.Job
eu.steffo.cleaver.logic.StitchJob
- All Implemented Interfaces:
java.lang.Runnable
public class StitchJob extends Job
A
Job
that converts chopped (*.chp + *.cXX) files back into regular files.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description StitchJob(java.io.File file)
Construct a StitchJob, specifying the *.chp file to import the settings from.StitchJob(java.io.File file, java.lang.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(java.io.File chpFile, java.lang.String cryptKey, java.lang.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()
java.io.File
getFile()
SplitConfig
getSplitConfig()
java.lang.String
getType()
protected static org.w3c.dom.Document
openChp(java.io.File file)
protected void
parseChp(org.w3c.dom.Document doc, java.lang.String cryptKey)
Read aDocument
and setsplitConfig
,cryptConfig
andcompressConfig
accordingly.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
-
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
public StitchJob(java.io.File file, java.lang.String cryptKey) throws ChpFileError, ProgrammingErrorConstruct 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(java.io.File chpFile, java.lang.String cryptKey, java.lang.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
public java.lang.String getType() -
getFile
public java.io.File 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
protected static org.w3c.dom.Document openChp(java.io.File file) throws ChpFileError, ProgrammingError- Throws:
ChpFileError
ProgrammingError
-
parseChp
protected final void parseChp(org.w3c.dom.Document doc, java.lang.String cryptKey) throws ChpFileErrorRead aDocument
and setsplitConfig
,cryptConfig
andcompressConfig
accordingly.- 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()
.
-