Package org.apache.tika.batch.fs
Class FSOutputStreamFactory
java.lang.Object
org.apache.tika.batch.fs.FSOutputStreamFactory
- All Implemented Interfaces:
OutputStreamFactory
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionFSOutputStreamFactory
(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
Modifier and TypeMethodDescriptiongetOutputStream
(Metadata metadata) This tries to create a file based on theFSUtil.HANDLE_EXISTING
value that was passed in during initialization.
-
Constructor Details
-
FSOutputStreamFactory
@Deprecated public FSOutputStreamFactory(File outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix) Deprecated.- Parameters:
outputRoot
-handleExisting
-compression
-suffix
-- See Also:
-
FSOutputStreamFactory
public FSOutputStreamFactory(Path outputRoot, FSUtil.HANDLE_EXISTING handleExisting, FSOutputStreamFactory.COMPRESSION compression, String suffix)
-
-
Method Details
-
getOutputStream
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
-