public class NioWorker extends StandardWorker
FsWorker
that uses java.nio to perform put and get operations.In the adapter configuration file this class is aliased as fs-nio-worker which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
NioWorker() |
Modifier and Type | Method and Description |
---|---|
byte[] |
get(java.io.File file)
Gets the contents of the specified
File . |
void |
put(byte[] data,
java.io.File file)
Writes
data to the specified file . |
protected void |
write(byte[] data,
java.io.File file) |
wrapException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkExists, checkNonExistent, checkReadable, checkWriteable, delete, isDirectory, isFile, isWriteableDir, listFiles, listFiles, rename
public void put(byte[] data, java.io.File file) throws FsException
FsWorker
Writes data
to the specified file
. If the named file already exists or if part of the path doesn't
exist a FsException
is thrown.
put
in interface FsWorker
put
in class StandardWorker
data
- the data to writefile
- the file to write toFsException
- wrapping any underlying Exception that may occurprotected void write(byte[] data, java.io.File file) throws FsException
FsException
public byte[] get(java.io.File file) throws FsException
FsWorker
Gets the contents of the specified File
. If the file doesn't exist or other I/O problems are encountered a
FsException
will be thrown.
get
in interface FsWorker
get
in class StandardWorker
file
- the File
to getFsException
- wrapping any underlying Exception that may occur