|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.component.file.FileOperations
public class FileOperations
File operations for File
.
Constructor Summary | |
---|---|
FileOperations()
|
|
FileOperations(FileEndpoint endpoint)
|
Method Summary | |
---|---|
boolean |
buildDirectory(String directory,
boolean absolute)
Builds the directory structure. |
void |
changeCurrentDirectory(String path)
Change the current remote directory |
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<File> |
listFiles()
List the files in the current directory |
List<File> |
listFiles(String path)
List the files in the given remote directory |
boolean |
renameFile(String from,
String to)
Renames the file |
boolean |
retrieveFile(String name,
Exchange exchange)
Retrieves the file |
void |
setEndpoint(GenericFileEndpoint<File> endpoint)
Sets the endpoint as some implementations need access to the endpoint and how its configured. |
boolean |
storeFile(String fileName,
Exchange exchange)
Stores the content as a new remote file (upload) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileOperations()
public FileOperations(FileEndpoint endpoint)
Method Detail |
---|
public void setEndpoint(GenericFileEndpoint<File> endpoint)
GenericFileOperations
setEndpoint
in interface GenericFileOperations<File>
endpoint
- the endpointpublic boolean deleteFile(String name) throws GenericFileOperationFailedException
GenericFileOperations
deleteFile
in interface GenericFileOperations<File>
name
- name of the file
GenericFileOperationFailedException
- can be thrownpublic boolean renameFile(String from, String to) throws GenericFileOperationFailedException
GenericFileOperations
renameFile
in interface GenericFileOperations<File>
from
- original nameto
- the new name
GenericFileOperationFailedException
- can be thrownpublic boolean existsFile(String name) throws GenericFileOperationFailedException
GenericFileOperations
existsFile
in interface GenericFileOperations<File>
name
- name of the file
GenericFileOperationFailedException
- can be thrownpublic boolean buildDirectory(String directory, boolean absolute) throws GenericFileOperationFailedException
GenericFileOperations
buildDirectory
in interface GenericFileOperations<File>
directory
- the directory path to build as a relative string nameabsolute
- wether the directory is an absolute or relative path
GenericFileOperationFailedException
- can be thrownpublic List<File> listFiles() throws GenericFileOperationFailedException
GenericFileOperations
listFiles
in interface GenericFileOperations<File>
GenericFileOperationFailedException
- can be thrownpublic List<File> listFiles(String path) throws GenericFileOperationFailedException
GenericFileOperations
listFiles
in interface GenericFileOperations<File>
path
- the remote directory
GenericFileOperationFailedException
- can be thrownpublic void changeCurrentDirectory(String path) throws GenericFileOperationFailedException
GenericFileOperations
changeCurrentDirectory
in interface GenericFileOperations<File>
path
- the path to change to
GenericFileOperationFailedException
- can be thrownpublic String getCurrentDirectory() throws GenericFileOperationFailedException
GenericFileOperations
getCurrentDirectory
in interface GenericFileOperations<File>
GenericFileOperationFailedException
- can be thrownpublic boolean retrieveFile(String name, Exchange exchange) throws GenericFileOperationFailedException
GenericFileOperations
retrieveFile
in interface GenericFileOperations<File>
name
- name of the fileexchange
- stream to write the content of the file into
GenericFileOperationFailedException
- can be thrownpublic boolean storeFile(String fileName, Exchange exchange) throws GenericFileOperationFailedException
GenericFileOperations
storeFile
in interface GenericFileOperations<File>
fileName
- name of new fileexchange
- with the content content of the file
GenericFileOperationFailedException
- can be thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |