public class FSOutputStreamFactory extends java.lang.Object implements OutputStreamFactory
| Modifier and Type | Class and Description |
|---|---|
static class |
FSOutputStreamFactory.COMPRESSION |
| Modifier and Type | Field and Description |
|---|---|
private FSOutputStreamFactory.COMPRESSION |
compression |
private FSUtil.HANDLE_EXISTING |
handleExisting |
private java.nio.file.Path |
outputRoot |
private java.lang.String |
suffix |
| Constructor and Description |
|---|
FSOutputStreamFactory(java.io.File outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
java.lang.String suffix)
Deprecated.
|
FSOutputStreamFactory(java.nio.file.Path outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
java.lang.String suffix) |
| Modifier and Type | Method and Description |
|---|---|
java.io.OutputStream |
getOutputStream(Metadata metadata)
This tries to create a file based on the
FSUtil.HANDLE_EXISTING
value that was passed in during initialization. |
private final FSUtil.HANDLE_EXISTING handleExisting
private final java.nio.file.Path outputRoot
private final java.lang.String suffix
private final FSOutputStreamFactory.COMPRESSION compression
@Deprecated
public FSOutputStreamFactory(java.io.File outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
java.lang.String suffix)
outputRoot - handleExisting - compression - suffix - FSOutputStreamFactory(Path, FSUtil.HANDLE_EXISTING, COMPRESSION, String)public FSOutputStreamFactory(java.nio.file.Path outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
java.lang.String suffix)
public java.io.OutputStream getOutputStream(Metadata metadata) throws java.io.IOException
FSUtil.HANDLE_EXISTING
value that was passed in during initialization.
If handleExisting is set to "SKIP" and the output file already exists,
this will return null.
If an output file can be found, this will try to mkdirs for that output file. If mkdirs() fails, this will throw an IOException.
Finally, this will open an output stream for the appropriate output file.
getOutputStream in interface OutputStreamFactorymetadata - must have a value set for FSMetadataProperties.FS_ABSOLUTE_PATH or
else NullPointerException will be thrown!java.io.IOException, - NullPointerExceptionjava.io.IOException