public class XmlSummaryFileTarget extends Object implements ExecutionTarget
ExecutionTarget that writes digests to an XML file.| Modifier and Type | Field and Description |
|---|---|
protected Iterable<? extends ArtifactListener> |
artifactListeners
List of listeners which are notified every time a XML file is created.
|
protected String |
encoding
Encoding to use for generated files.
|
protected Map<ChecksumFile,Map<String,String>> |
filesHashcodes
The association file => (algorithm,hashcode).
|
protected File |
summaryFile
The target file where the summary is written.
|
static int |
XML_INDENTATION_SIZE
The number of spaces used to indent the output file.
|
| Constructor and Description |
|---|
XmlSummaryFileTarget(File summaryFile,
String encoding,
Iterable<? extends ArtifactListener> artifactListeners)
Build a new instance of
XmlSummaryFileTarget. |
| 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.
|
public static final int XML_INDENTATION_SIZE
protected String encoding
protected Map<ChecksumFile,Map<String,String>> filesHashcodes
protected File summaryFile
protected final Iterable<? extends ArtifactListener> artifactListeners
public XmlSummaryFileTarget(File summaryFile, String encoding, Iterable<? extends ArtifactListener> artifactListeners)
XmlSummaryFileTarget.summaryFile - the file to which the summary should be written.encoding - the encoding to use for generated files.artifactListeners - public void init()
Should be called before first call to ExecutionTarget.write(String, ChecksumFile, String).
init in interface ExecutionTargetpublic void write(String digest, ChecksumFile file, String algorithm)
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.public void close(String subPath) throws ExecutionTargetCloseException
Should be called after last call to ExecutionTarget.write(String, ChecksumFile, String).
close in interface ExecutionTargetExecutionTargetCloseException - if an error occured while closing the target.Copyright © 2010–2016. All rights reserved.