Class DropboxAPIFacade

java.lang.Object
org.apache.camel.component.dropbox.core.DropboxAPIFacade

public final class DropboxAPIFacade extends Object
  • Constructor Details

    • DropboxAPIFacade

      public DropboxAPIFacade(com.dropbox.core.v2.DbxClientV2 client, org.apache.camel.Exchange exchange)
      Parameters:
      client - the DbxClient performing dropbox low level operations
      exchange - 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 filesystem
      remotePath - the remote path destination on dropbox
      mode - 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

      public DropboxSearchResult search(String remotePath, String query) throws DropboxException
      Search inside a remote path including its subdirectories. The query param can be null.
      Parameters:
      remotePath - the remote path where starting the search from
      query - 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

      public DropboxDelResult del(String remotePath) throws DropboxException
      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

      public DropboxMoveResult move(String remotePath, String newRemotePath) throws DropboxException
      Rename a remote path with the new path location.
      Parameters:
      remotePath - the existing remote path to be renamed
      newRemotePath - 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

      public DropboxFileDownloadResult get(String remotePath) throws DropboxException
      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