Class DropboxAPIFacade
java.lang.Object
org.apache.camel.component.dropbox.core.DropboxAPIFacade
-
Constructor Summary
ConstructorsConstructorDescriptionDropboxAPIFacade(com.dropbox.core.v2.DbxClientV2 client, org.apache.camel.Exchange exchange) -
Method Summary
Modifier and TypeMethodDescriptionDelete every file and subdirectory inside the remote directory.Get the content of every file inside the remote path.Rename a remote path with the new path location.put(String localPath, String remotePath, DropboxUploadMode mode) Put or upload a new file or an entire directory to dropboxSearch inside a remote path including its subdirectories.
-
Constructor Details
-
DropboxAPIFacade
public DropboxAPIFacade(com.dropbox.core.v2.DbxClientV2 client, org.apache.camel.Exchange exchange) - Parameters:
client- the DbxClient performing dropbox low level operationsexchange- the current Exchange
-
-
Method Details
-
put
public DropboxFileUploadResult put(String localPath, String remotePath, DropboxUploadMode mode) throws DropboxException Put or upload a new file or an entire directory to dropbox- Parameters:
localPath- the file path or the dir path on the local filesystemremotePath- the remote path destination on dropboxmode- how a file should be saved on dropbox; in case of "add" the new file will be renamed in case a file with the same name already exists on dropbox. in case of "force" the file already existing with the same name will be overridden.- Returns:
- a result object reporting for each remote path the result of the operation.
- Throws:
DropboxException- if an error occurs
-
search
Search inside a remote path including its subdirectories. The query param can be null.- Parameters:
remotePath- the remote path where starting the search fromquery- a space-separated list of substrings to search for. A file matches only if it contains all the substrings- Returns:
- a result object containing all the files found.
- Throws:
DropboxException- if an error occurs
-
del
Delete every file and subdirectory inside the remote directory. In case the remotePath is a file, delete the file.- Parameters:
remotePath- the remote location to delete- Returns:
- a result object with the result of the delete operation.
- Throws:
DropboxException- if an error occurs
-
move
Rename a remote path with the new path location.- Parameters:
remotePath- the existing remote path to be renamednewRemotePath- the new remote path substituting the old one- Returns:
- a result object with the result of the move operation.
- Throws:
DropboxException- if an error occurs
-
get
Get the content of every file inside the remote path.- Parameters:
remotePath- the remote path where to download from- Returns:
- a result object with the content (ByteArrayOutputStream) of every files inside the remote path.
- Throws:
DropboxException- if an error occurs
-