java.lang.Object |
↳ |
org.mule.modules.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
Public Methods |
Item
|
copy(String from, String to)
Copies a file or folder to a new location.
|
Item
|
createFolder(String path)
Create new folder on Dropbox
|
Item
|
delete(String path)
Deletes a file or folder.
|
InputStream
|
downloadFile(String path, boolean delete)
Downloads a file from Dropbox
|
String
|
getAccessToken()
|
AccountInformation
|
getAccount()
Requests the account's information.
|
String
|
getAppKey()
|
String
|
getAppSecret()
|
String
|
getContentServer()
|
Link
|
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.
|
String
|
getOAuthTokenAccessIdentifier()
|
String
|
getServer()
|
void
|
init()
This method initiates the dropbox client and the auth callback.
|
Item
|
list(String path)
Lists the content of the remote directory
|
Item
|
move(String from, String to)
Moves a file or folder to a new location.
|
void
|
setAccessToken(String accessToken)
|
void
|
setAppKey(String appKey)
|
void
|
setAppSecret(String appSecret)
|
void
|
setContentServer(String contentServer)
|
void
|
setServer(String server)
|
Item
|
uploadLongStream(InputStream fileData, Boolean overwrite, String path, String filename)
Upload file to Dropbox.
|
Item
|
uploadStream(InputStream fileData, Boolean overwrite, String path, String filename)
Upload file to Dropbox.
|
[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
int
MAX_UPLOAD_BUFFER_LEN
Constant Value:
4194304
(0x00400000)
private
static
final
String
ROOT_PARAM
Constant Value:
"dropbox"
Fields
private
String
accessToken
private
String
accessTokenIdentifier
private
WebResource
apiResource
private
WebResource
contentResource
private
String
contentServer
URL of the Dropbox server content API
private
JerseyUtil
jerseyUtil
private
JerseyUtil
jerseyUtilUpload
private
String
server
URL of the Dropbox server API
Public Constructors
public
DropboxConnector
()
Public Methods
public
Item
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. |
Returns
- Item with the metadata of the copied object
public
Item
createFolder
(String path)
Create new folder on Dropbox
Parameters
path
| Full path of the folder to be created |
Returns
- Item with the metadata of the created folder
public
Item
delete
(String path)
Deletes a file or folder.
Parameters
path
| Full path to the file to be deleted |
Returns
- Item with the metadata of the deleted object
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
()
Requests the account's information.
Returns
- AccountInformation. A Dropbox account's information.
public
String
getAppKey
()
public
String
getAppSecret
()
public
String
getContentServer
()
public
Link
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
- Link. A Dropbox link to the given path.
public
String
getOAuthTokenAccessIdentifier
()
public
String
getServer
()
public
void
init
()
This method initiates the dropbox client and the auth callback.
public
Item
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
Item
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. |
Returns
- Item with the metadata of the moved object
public
void
setAccessToken
(String accessToken)
public
void
setAppKey
(String appKey)
public
void
setAppSecret
(String appSecret)
public
void
setContentServer
(String contentServer)
public
void
setServer
(String server)
public
Item
uploadLongStream
(InputStream fileData, Boolean overwrite, String path, String filename)
Upload file to Dropbox. The payload is an InputStream containing bytes of
the data to be uploaded.
This version of the method supports streams of arbitrary length
Parameters
fileData
| File to be uploaded |
overwrite
| Overwrite file in case it already exists |
path
| The destination path |
filename
| The destination file name |
Returns
- Item with the metadata of the uploaded object
public
Item
uploadStream
(InputStream fileData, Boolean overwrite, String path, String filename)
Upload file to Dropbox. The payload is an InputStream containing bytes of
the data to be uploaded.
You can upload files of up to 150MB with this method. Use upload-long-stream for larger files
Parameters
fileData
| File to be uploaded |
overwrite
| Overwrite file in case it already exists |
path
| The destination path |
filename
| The destination file name |
Returns
- Item with the metadata of the uploaded object