public interface GenericFileOperations<T>
Modifier and Type | Method and Description |
---|---|
boolean |
buildDirectory(String directory,
boolean absolute)
Builds the directory structure.
|
void |
changeCurrentDirectory(String path)
Change the current remote directory
|
void |
changeToParentDirectory()
Change the current remote directory to the parent
|
boolean |
deleteFile(String name)
Deletes the file name by name, relative to the current directory
|
boolean |
existsFile(String name)
Determines whether the files exists or not
|
String |
getCurrentDirectory()
Gets the current remote directory
|
List<T> |
listFiles()
List the files in the current directory
|
List<T> |
listFiles(String path)
List the files in the given remote directory
|
void |
releaseRetrievedFileResources(Exchange exchange)
Releases the resources consumed by a retrieved file
|
boolean |
renameFile(String from,
String to)
Renames the file
|
boolean |
retrieveFile(String name,
Exchange exchange,
long size)
Retrieves the file
|
void |
setEndpoint(GenericFileEndpoint<T> endpoint)
Sets the endpoint as some implementations need access to the endpoint and how its configured.
|
boolean |
storeFile(String name,
Exchange exchange,
long size)
Stores the content as a new remote file (upload)
|
void setEndpoint(GenericFileEndpoint<T> endpoint)
endpoint
- the endpointboolean deleteFile(String name) throws GenericFileOperationFailedException
name
- name of the fileGenericFileOperationFailedException
- can be thrownboolean existsFile(String name) throws GenericFileOperationFailedException
name
- name of the fileGenericFileOperationFailedException
- can be thrownboolean renameFile(String from, String to) throws GenericFileOperationFailedException
from
- original nameto
- the new nameGenericFileOperationFailedException
- can be thrownboolean buildDirectory(String directory, boolean absolute) throws GenericFileOperationFailedException
directory
- the directory path to build as a relative string nameabsolute
- wether the directory is an absolute or relative pathGenericFileOperationFailedException
- can be thrownboolean retrieveFile(String name, Exchange exchange, long size) throws GenericFileOperationFailedException
name
- name of the fileexchange
- stream to write the content of the file intosize
- the total file size to retrieve, if possible to determineGenericFileOperationFailedException
- can be thrownvoid releaseRetrievedFileResources(Exchange exchange) throws GenericFileOperationFailedException
exchange
- exchange with the content of the fileGenericFileOperationFailedException
- can be thrownboolean storeFile(String name, Exchange exchange, long size) throws GenericFileOperationFailedException
name
- name of new fileexchange
- with the content content of the filesize
- the total file size to store, if possible to determineGenericFileOperationFailedException
- can be thrownString getCurrentDirectory() throws GenericFileOperationFailedException
GenericFileOperationFailedException
- can be thrownvoid changeCurrentDirectory(String path) throws GenericFileOperationFailedException
path
- the path to change toGenericFileOperationFailedException
- can be thrownvoid changeToParentDirectory() throws GenericFileOperationFailedException
GenericFileOperationFailedException
- can be thrownList<T> listFiles() throws GenericFileOperationFailedException
GenericFileOperationFailedException
- can be thrownList<T> listFiles(String path) throws GenericFileOperationFailedException
path
- the remote directoryGenericFileOperationFailedException
- can be thrownApache Camel