| java.lang.Object |
| ↳ |
com.mulesoft.module.dropbox.DropboxConnector |
Known Direct Subclasses
|
Known Indirect Subclasses
|
Class Overview
Dropbox Cloud Connector.
The Dropbox Connector will allow to use the Dropbox REST API. Almost every operation that can be done via the API can be done thru this connector.
Summary
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
private
static
final
String
API_CONTENT_URL
Constant Value:
"files/dropbox"
private
static
final
String
API_VERSION
private
static
final
String
ROOT_PARAM
Constant Value:
"dropbox"
Fields
private
String
accessToken
private
String
accessTokenSecret
private
String
contentServer
URL of the Dropbox server content API
private
String
server
URL of the Dropbox server API
Public Constructors
public
DropboxConnector
()
Public Methods
public
String
copy
(String from, String to)
Copies a file or folder to a new location.
Parameters
| from
| Specifies the file or folder to be copied from, relative to
root. |
| to
| Specifies the destination path, including the new name for the
file or folder, relative to root. |
public
String
createFolder
(String path)
Create new folder on Dropbox
Parameters
| path
| Full path of the folder to be created |
public
String
delete
(String path)
Deletes a file or folder.
Parameters
| path
| Full path to the file to be deleted |
public
InputStream
downloadFile
(String path, boolean delete)
Downloads a file from Dropbox
Parameters
| path
| Path to the file |
| delete
| Delete the file on the Dropbox after download (ignored if
moveTo is set) |
Returns
- Stream containing the downloaded file data
public
String
getAccessToken
()
public
String
getAccessTokenSecret
()
public
String
getAppKey
()
public
String
getAppSecret
()
public
String
getContentServer
()
public
String
getLink
(String path, Boolean shortUrl)
Creates and returns a Dropbox link to files or folders users can use to view a preview of the file in a web browser.
Parameters
| path
| The path to the file or folder you want to link to. |
| shortUrl
| Boolean indicating if the url returned will be shortened using the Dropbox url shortener (when true) or will link directly to the file's preview page (when false). |
Returns
- String. A Dropbox link to the given path.
public
String
getServer
()
public
boolean
isDebug
()
public
List<String>
list
(String path)
Lists the content of the remote directory
Parameters
| path
| Path to the remote directory |
Returns
- List of files and/or folders
public
String
move
(String from, String to)
Moves a file or folder to a new location.
Parameters
| from
| Specifies the file or folder to be moved from, relative to
root. |
| to
| Specifies the destination path, including the new name for the
file or folder, relative to root. |
public
void
setAccessToken
(String accessToken)
public
void
setAccessTokenSecret
(String accessTokenSecret)
public
void
setAppKey
(String appKey)
public
void
setAppSecret
(String appSecret)
public
void
setContentServer
(String contentServer)
public
void
setDebug
(boolean debug)
public
void
setPort
(int port)
public
void
setServer
(String server)
public
String
uploadFile
(InputStream fileDataObj, Boolean overwrite, String path, String filename)
Upload file to Dropbox. The payload is an InputStream containing bytes of
the data to be uploaded.
Parameters
| fileDataObj
| File to be uploaded |
| overwrite
| Overwrite file in case it already exists |
| path
| The destination path |
| filename
| The destination file name |
Protected Methods
protected
String
getApiContentUrl
(String path)
protected
Client
getClient
()
protected
OAuthClientFilter
getOAuthClientFilter
(String accessToken, String accessTokenSecret)
Parameters
| accessToken
| |
| accessTokenSecret
| |