public class OneHashPerFileTarget extends Object implements ExecutionTarget
ExecutionTarget that writes digests to separate files.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendFilename
Append the filename to the hash file
|
protected Iterable<? extends ArtifactListener> |
artifactListeners
List of listeners which are notified every time a checksum file is created.
|
protected String |
encoding
Encoding to use for generated files.
|
protected File |
outputDirectory
The files output directory.
|
| Constructor and Description |
|---|
OneHashPerFileTarget(String encoding,
File outputDirectory,
Iterable<? extends ArtifactListener> artifactListeners)
Build a new instance of
OneHashPerFileTarget. |
OneHashPerFileTarget(String encoding,
File outputDirectory,
Iterable<? extends ArtifactListener> artifactListeners,
boolean appendFilename)
Build a new instance of
OneHashPerFileTarget. |
OneHashPerFileTarget(String encoding,
Iterable<? extends ArtifactListener> artifactListeners)
Build a new instance of
OneHashPerFileTarget. |
| Modifier and Type | Method and Description |
|---|---|
void |
close(String subPath)
Close the target.
|
void |
init()
Initialize the target.
|
void |
write(String digest,
ChecksumFile file,
String algorithm)
Write the hashcode calculated for the given file and algorithm to the target.
|
protected String encoding
protected File outputDirectory
protected final Iterable<? extends ArtifactListener> artifactListeners
protected boolean appendFilename
public OneHashPerFileTarget(String encoding, File outputDirectory, Iterable<? extends ArtifactListener> artifactListeners)
OneHashPerFileTarget.encoding - the encoding to use for generated files.outputDirectory - the files output directory.artifactListeners - listeners which are notified every time a CSV file is createdpublic OneHashPerFileTarget(String encoding, File outputDirectory, Iterable<? extends ArtifactListener> artifactListeners, boolean appendFilename)
OneHashPerFileTarget.encoding - the encoding to use for generated files.outputDirectory - the files output directory.artifactListeners - listeners which are notified every time a CSV file is createdappendFilename - add filename in generated filepublic OneHashPerFileTarget(String encoding, Iterable<? extends ArtifactListener> artifactListeners)
OneHashPerFileTarget.encoding - the encoding to use for generated files.artifactListeners - listeners which are notified every time a CSV file is createdpublic void init()
throws ExecutionTargetInitializationException
Should be called before first call to ExecutionTarget.write(String, ChecksumFile, String).
init in interface ExecutionTargetExecutionTargetInitializationException - if an error occured while initializing the target.public void write(String digest, ChecksumFile file, String algorithm) throws ExecutionTargetWriteException
write in interface ExecutionTargetdigest - the digest to write.file - the file for which the digest was calculated.algorithm - the algorithm used to calculate the digest.ExecutionTargetWriteException - if an error occured while writing to the target.public void close(String subPath)
Should be called after last call to ExecutionTarget.write(String, ChecksumFile, String).
close in interface ExecutionTargetsubPath - part of relative path to exclude from file pathCopyright © 2010–2018. All rights reserved.