public class FSOutputStreamFactory extends Object implements OutputStreamFactory
Modifier and Type | Class and Description |
---|---|
static class |
FSOutputStreamFactory.COMPRESSION |
Constructor and Description |
---|
FSOutputStreamFactory(File outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
String suffix)
Deprecated.
|
FSOutputStreamFactory(Path outputRoot,
FSUtil.HANDLE_EXISTING handleExisting,
FSOutputStreamFactory.COMPRESSION compression,
String suffix) |
Modifier and Type | Method and Description |
---|---|
OutputStream |
getOutputStream(Metadata metadata)
This tries to create a file based on the
FSUtil.HANDLE_EXISTING
value that was passed in during initialization. |
@Deprecated public FSOutputStreamFactory(File outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix)
outputRoot
- handleExisting
- compression
- suffix
- FSOutputStreamFactory(Path, FSUtil.HANDLE_EXISTING, COMPRESSION, String)
public FSOutputStreamFactory(Path outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix)
public OutputStream getOutputStream(Metadata metadata) throws 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 OutputStreamFactory
metadata
- must have a value set for FSMetadataProperties.FS_ABSOLUTE_PATH or
else NullPointerException will be thrown!java.io.IOException,
- NullPointerExceptionIOException
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.