public class OutputSpooler extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
OutputSpooler.CountingOutputStream |
class |
OutputSpooler.RecordingDigestOutputStream |
| Constructor and Description |
|---|
OutputSpooler(SpoolOutTarget target) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDigest(String algorithm) |
void |
addOutput(String fileName,
String mimeType) |
void |
addOutput(String fileName,
String mimeType,
IOFunction<OutputStream,OutputStream> transformer) |
String |
getChecksum(String fileName,
String algorithm)
Get the digest of a closed file
|
long |
getSize(String fileName)
Get the size of a closed file
|
void |
open(IOConsumer<OutputStream> consumer) |
protected void |
openNext(List<OutputStream> streams,
Iterator<Map.Entry<String,org.eclipse.packagedrone.utils.io.OutputSpooler.OutputEntry>> entries,
IOConsumer<List<OutputStream>> streamsConsumer) |
public OutputSpooler(SpoolOutTarget target)
public void addDigest(String algorithm)
public void addOutput(String fileName, String mimeType, IOFunction<OutputStream,OutputStream> transformer)
public void open(IOConsumer<OutputStream> consumer) throws IOException
IOExceptionprotected void openNext(List<OutputStream> streams, Iterator<Map.Entry<String,org.eclipse.packagedrone.utils.io.OutputSpooler.OutputEntry>> entries, IOConsumer<List<OutputStream>> streamsConsumer) throws IOException
IOExceptionpublic String getChecksum(String fileName, String algorithm)
fileName - the file name to get the digest foralgorithm - the digest algorithmnull if the digest was not requested.
The digest will be lower case hex encoded.IllegalStateException - If the file is still open or was never openedpublic long getSize(String fileName)
fileName - the file name to get the size forIllegalStateException - If the file is still open or was never openedCopyright © 2016. All rights reserved.