public abstract class AbstractArchiveExtractor<C extends ApplicationContext,E extends ArchiveEntry> extends AbstractAsyncExecutable<C>
ProgressInputStream
.childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Modifier | Constructor and Description |
---|---|
protected |
AbstractArchiveExtractor(C ctx,
LogChannel logCh,
java.lang.String taskName) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkStreamAccess() |
protected java.io.OutputStream |
createOutputStream(java.io.File outFile)
May be overridden to create a particular FileOutputStream
|
protected void |
displayArchiveEntry(java.io.InputStream inStream,
E entry)
Prints the unix pathname of the entry by default
|
protected void |
displayHeader(java.lang.String headerInfo) |
protected void |
doOnDirectoryCreated(E entry,
java.io.File relativeDir) |
protected void |
doOnFileCreated(E entry,
java.io.File file) |
protected void |
doOnFileCreating(E entry)
Passes the relative fileName as argument.
|
void |
executeAsync()
Contains the code to be executed asynchronously.
|
protected void |
extractAsDirectory(E entry) |
protected void |
extractToFile(java.io.InputStream inStream,
E entry) |
protected abstract FileType |
getArchiveType() |
java.io.File |
getInputFile() |
java.io.File |
getTargetDir() |
protected boolean |
isShouldExtract(E entry)
May be overridden in order to filter which
ArchiveEntry should be extracted. |
protected abstract void |
processArchive() |
void |
setExtractionFilter(ArchiveEntryFilter filter)
Allows to filter what should be extracted.
|
void |
setInputFile(java.io.File tarInFile)
Sets the input file which must be a ZIP or JAR archive.
|
void |
setTargetDir(java.io.File targetDir) |
addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApplicationContext
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
protected AbstractArchiveExtractor(C ctx, LogChannel logCh, java.lang.String taskName)
public final void setInputFile(java.io.File tarInFile)
public final java.io.File getInputFile()
public final void setTargetDir(java.io.File targetDir)
public final java.io.File getTargetDir()
public final void setExtractionFilter(ArchiveEntryFilter filter)
public final void executeAsync() throws java.lang.Exception
AsyncExecutable
Runnable.run()
for async execution.executeAsync
in interface AsyncExecutable<C extends ApplicationContext>
executeAsync
in class AbstractAsyncExecutable<C extends ApplicationContext>
java.lang.Exception
for synchronous execution
protected void displayHeader(java.lang.String headerInfo)
protected void displayArchiveEntry(java.io.InputStream inStream, E entry) throws java.lang.Exception
java.lang.Exception
protected java.io.OutputStream createOutputStream(java.io.File outFile) throws java.lang.Exception
java.lang.Exception
protected final void checkStreamAccess()
protected final boolean isShouldExtract(E entry)
ArchiveEntry
should be extracted.protected void extractAsDirectory(E entry) throws java.lang.Exception
java.lang.Exception
protected void extractToFile(java.io.InputStream inStream, E entry) throws java.lang.Exception
java.lang.Exception
protected void doOnDirectoryCreated(E entry, java.io.File relativeDir)
protected void doOnFileCreating(E entry)
protected void doOnFileCreated(E entry, java.io.File file)
protected abstract FileType getArchiveType()
protected abstract void processArchive() throws java.lang.Exception
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.