org.schmant.task.at4j.zip
Class At4JZipTask
java.lang.Object
org.schmant.support.AbstractArgumentChecker
org.schmant.task.stub.AbstractTask<T>
org.schmant.task.stub.AbstractActionTask<T>
org.schmant.task.stub.AbstractProcessTask<T>
org.schmant.task.template.io.zip.AbstractZipTask<At4JZipTask>
org.schmant.task.at4j.zip.At4JZipTask
- All Implemented Interfaces:
- Producer<EFile>, TaskDependency, ActionTaskConfigurable<At4JZipTask>, ActionTaskSpec<At4JZipTask>, LoggingConfigurable<At4JZipTask>, OverwriteConfigurable<At4JZipTask>, SourceConfigurable<At4JZipTask>, SourceConfigured, TargetConfigurable<At4JZipTask>, TargetConfigured, GeneratorTaskConfigurable<At4JZipTask>, GeneratorTaskSpec<At4JZipTask>, ProcessTaskConfigurable<At4JZipTask>, ProcessTaskSpec<At4JZipTask>, Task, TaskRunnable, TaskSpecification<At4JZipTask>
public final class At4JZipTask
- extends AbstractZipTask<At4JZipTask>
- implements Producer<EFile>
See At4JZipTF
- Since:
- 0.8
- Author:
- Karl Gustafsson
- Task_package:
- org.at4j
Methods inherited from class org.schmant.task.stub.AbstractTask |
cancel, createTask, getDefaultLogFooter, getDefaultLogHeader, getDependencyForTasksScheduledByThisTask, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
get
public EFile get()
- Description copied from interface:
Producer
- Returns the produced object, or
null
if nothing is produced
yet.
This method should be implemented thread-safe.
- Specified by:
get
in interface Producer<EFile>
- Returns:
- The produced object.
addToZipBuilder
protected void addToZipBuilder(ZipBuilder zb,
Object src)
throws ArgumentInterpretationException
- This method interprets the argument and adds it to the Zip builder.
The argument is interpreted using the following rules:
- If it is an
EntityAndAbsoluteLocation
object, use the absolute location
for the entry and start over trying to interpret the entity from the first
rule.
- If it is a
ZipEntryAndSettings
object, remember the entry
settings and start over trying to interpret the entity from the first rule.
- If it is a
ZipDirectoryWithRules
object, remember the rules
and start over trying to interpret the entity from the first rule.
- If the source can be interpreted using the
ArgumentInterpreter.getReadOnlyDirectoryOrNull(java.lang.Object)
method, add the contents of the directory recursively. If an absolute
location is available, use that as the directory hierarchy's root
directory in the Zip file. If rules are available, use them. If no rules
are available, but a settings object is, use the settings for all added
entries.
- If the source can be interpreted using the
ArgumentInterpreter.getNamedReadableFileOrNull(java.lang.Object)
method, add the file. If an absolute location is available, use that
as the location of the file's parent directory. If a settings object is
available, use that.
- If the source can be interpreted using the
ArgumentInterpreter.getReadableFileOrNull(java.lang.Object)
method, add the file at the location given by the absolute location
object, which must be available. If a settings object is available, use
that.
- If the source is an
InputStream
, add the contents
read from the stream at the location given by the absolute location
object, which must be available. If a settings object is available, use
that.
- If none of the previous rules matched, throw an
ArgumentInterpretationException
.
- Parameters:
zb
- The zip builder.src
- The object to interpret and add to the builder.
- Throws:
ArgumentInterpretationException
- If the source object could not be
interpreted.
runInternal
protected void runInternal(Report r)
throws Exception
- Description copied from class:
AbstractTask
- Subclasses implement this. The task is
AbstractTask.validate(Report)
:d before
this method is called, see AbstractTask.run()
.
- Specified by:
runInternal
in class AbstractTask<At4JZipTask>
- Parameters:
r
- The current thread's Report
.
- Throws:
Exception
- On errors.
copyProperties
public void copyProperties(At4JZipTask spec)
- Description copied from class:
AbstractActionTask
- Override the implementation from
AbstractTask
to copy the
source properties. Subclasses must override this to copy their own
properties.
- Specified by:
copyProperties
in interface TaskSpecification<At4JZipTask>
- Overrides:
copyProperties
in class AbstractProcessTask<At4JZipTask>
- Parameters:
spec
- The specification to copy properties to.