public class StandardWorker extends java.lang.Object implements FsWorker
FsWorker
that uses standard java.io to perform put and get operations.In the adapter configuration file this class is aliased as fs-standard-worker which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
StandardWorker() |
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 FsException |
wrapException(java.lang.Exception e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkExists, checkNonExistent, checkReadable, checkWriteable, delete, isDirectory, isFile, isWriteableDir, listFiles, listFiles, rename
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
file
- the File
to getFsException
- wrapping any underlying Exception that may occurpublic 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
data
- the data to writefile
- the file to write toFsException
- wrapping any underlying Exception that may occurprotected FsException wrapException(java.lang.Exception e)