T
- shared-state of CopyFilesNaming
public class RecordingCounter<T> extends Object
The following outputs are produced:
Output Name | Default? | Description |
---|---|---|
no | a text log file showing each copy operation (and any skipped files). | |
no | a CSV file showing the source and destination paths for each copy operation (skipped files are not included).. |
Constructor and Description |
---|
RecordingCounter(Counter counter,
Outputter outputter,
T namingSharedState) |
Modifier and Type | Method and Description |
---|---|
void |
closeLogger()
Closes the logger.
|
T |
getNamingSharedState() |
int |
incrementCounter()
Increments the counter.
|
void |
recordCopiedOutput(Path source,
Optional<Path> destination,
int index)
Records an copy operation in the log / CSV path mapping.
|
public RecordingCounter(Counter counter, Outputter outputter, T namingSharedState) throws OperationFailedException
OperationFailedException
public int incrementCounter()
This is thread-safe.
public void recordCopiedOutput(Path source, Optional<Path> destination, int index) throws OperationFailedException
This also performs a check that multiple files are writing to the same output destination.
source
- source-path for copying operationdestination
- destination-path for copying operationindex
- the index of file (an integer number uniquely assigned to each operation)OperationFailedException
- if this method has been previously called with an identical
destination
(only if it's not-empty).public void closeLogger()
public T getNamingSharedState()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.