@Description(value="Opens a file.")
@In(value=java.lang.String.class)
@Out(value=java.io.Reader.class)
@FluxCommand(value="open-file")
public final class FileOpener
extends org.metafacture.framework.helpers.DefaultObjectPipe<java.lang.String,org.metafacture.framework.ObjectReceiver<java.io.Reader>>
| Constructor and Description |
|---|
FileOpener()
Creates an instance of
FileOpener. |
| Modifier and Type | Method and Description |
|---|---|
FileCompression |
getCompression()
Gets the file compression.
|
boolean |
getDecompressConcatenated()
Checks whether the file compression is set to decompress concatenated.
|
java.lang.String |
getEncoding()
Returns the encoding used to open the resource.
|
java.io.Reader |
open(java.io.InputStream stream)
Opens a file stream.
|
java.io.Reader |
open(java.lang.String file)
Opens a file.
|
void |
process(java.lang.String file) |
void |
setCompression(FileCompression compression)
Sets the compression of the file.
|
void |
setCompression(java.lang.String compression)
Sets the compression of the file.
|
void |
setDecompressConcatenated(boolean decompressConcatenated)
Flags whether to use decompress concatenated file compression.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding used to open the resource.
|
closeStream, getReceiver, isClosed, onCloseStream, onResetStream, onSetReceiver, resetStream, setReceiverpublic FileOpener()
FileOpener.public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding - new encodingpublic FileCompression getCompression()
FileCompressionpublic void setCompression(FileCompression compression)
compression - the FileCompressionpublic void setCompression(java.lang.String compression)
compression - the name of the compressionpublic boolean getDecompressConcatenated()
public void setDecompressConcatenated(boolean decompressConcatenated)
decompressConcatenated - true if file compression should decompress concatenatedpublic java.io.Reader open(java.lang.String file)
throws java.io.IOException
file - the filejava.io.IOException - if an I/O error occurspublic java.io.Reader open(java.io.InputStream stream)
throws java.io.IOException
stream - the streamjava.io.IOException - if an I/O error occurspublic void process(java.lang.String file)
process in interface org.metafacture.framework.ObjectReceiver<java.lang.String>process in class org.metafacture.framework.helpers.DefaultObjectPipe<java.lang.String,org.metafacture.framework.ObjectReceiver<java.io.Reader>>