Package org.apache.tika.batch.fs
Class FSOutputStreamFactory
- java.lang.Object
-
- org.apache.tika.batch.fs.FSOutputStreamFactory
-
- All Implemented Interfaces:
OutputStreamFactory
public class FSOutputStreamFactory extends Object implements OutputStreamFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FSOutputStreamFactory.COMPRESSION
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStream
getOutputStream(Metadata metadata)
This tries to create a file based on theFSUtil.HANDLE_EXISTING
value that was passed in during initialization.
-
-
-
Constructor Detail
-
FSOutputStreamFactory
@Deprecated public FSOutputStreamFactory(File outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix)
Deprecated.- Parameters:
outputRoot
-handleExisting
-compression
-suffix
-- See Also:
FSOutputStreamFactory(Path, FSUtil.HANDLE_EXISTING, COMPRESSION, String)
-
FSOutputStreamFactory
public FSOutputStreamFactory(Path outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix)
-
-
Method Detail
-
getOutputStream
public OutputStream getOutputStream(Metadata metadata) throws IOException
This tries to create a file based on theFSUtil.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.
- Specified by:
getOutputStream
in interfaceOutputStreamFactory
- Parameters:
metadata
- must have a value set for FSMetadataProperties.FS_ABSOLUTE_PATH or else NullPointerException will be thrown!- Returns:
- OutputStream
- Throws:
IOException
-
-