Dropbox
class Dropbox (View source)
Dropbox
Constants
AUTO_CHUNKED_UPLOAD_THRESHOLD |
Uploading a file with the 'uploadFile' method, with the file's
size less than this value (~8 MB), the simple |
DEFAULT_CHUNK_SIZE |
The Chunk Size the file will be split into and uploaded (~4 MB) |
METADATA_HEADER |
Response header containing file metadata |
Properties
protected DropboxApp | $app | The Dropbox App | |
protected string | $accessToken | OAuth2 Access Token | |
protected DropboxClient | $client | Dropbox Client | |
protected OAuth2Client | $oAuth2Client | OAuth2 Client | |
protected RandomStringGeneratorInterface | $randomStringGenerator | Random String Generator | |
protected PersistentDataStoreInterface | $persistentDataStore | Persistent Data Store |
Methods
Get the Client
Get the Access Token.
Get the Dropbox App.
Get OAuth2Client
Get the Random String Generator
Get Persistent Data Store
Get Dropbox Auth Helper
Set the Access Token.
Make Request to the API
Make a HTTP POST Request to the API endpoint type
Make a HTTP POST Request to the Content endpoint type
Make DropboxFile Object
Get the Metadata for a file or folder
Get the contents of a Folder
Paginate through all files and retrieve updates to the folder, using the cursor retrieved from listFolder or listFolderContinue
Get a cursor for the folder's state.
Get Revisions of a File
Search a folder for files/folders
Create a folder at the given path
Delete a file or folder at the given path
Move a file or folder to a different location
Copy a file or folder to a different location
Restore a file to the specific version
Get Copy Reference
Save Copy Reference
Get a temporary link to stream contents of a file
Save a specified URL into a file in user's Dropbox
Save a specified URL into a file in user's Dropbox
Upload a File to Dropbox
Upload a File to Dropbox in a single request
Start an Upload Session
Finish an upload session and save the uploaded data to the given file path
Append more data to an Upload Session
Upload file in sessions/chunks
Get thumbnail size
Get a thumbnail for an image
Get Current Account
Get Account
Get Multiple Accounts in one call
Get Space Usage for the current user's account
Details
at line line 103
__construct(DropboxApp $app, array $config = array())
Create a new Dropbox instance
at line line 136
DropboxClient
getClient()
Get the Client
at line line 146
string
getAccessToken()
Get the Access Token.
at line line 156
DropboxApp
getApp()
Get the Dropbox App.
at line line 166
OAuth2Client
getOAuth2Client()
Get OAuth2Client
at line line 184
RandomStringGeneratorInterface
getRandomStringGenerator()
Get the Random String Generator
at line line 194
PersistentDataStoreInterface
getPersistentDataStore()
Get Persistent Data Store
at line line 204
DropboxAuthHelper
getAuthHelper()
Get Dropbox Auth Helper
at line line 240
DropboxResponse
sendRequest(string $method, string $endpoint, string $endpointType = 'api', array $params = array(), string $accessToken = null)
Make Request to the API
at line line 262
DropboxResponse
postToAPI(string $endpoint, array $params = array(), string $accessToken = null)
Make a HTTP POST Request to the API endpoint type
at line line 276
DropboxResponse
postToContent(string $endpoint, array $params = array(), string $accessToken = null)
Make a HTTP POST Request to the Content endpoint type
at line line 288
ModelInterface
makeModelFromResponse(DropboxResponse $response)
Make Model from DropboxResponse
at line line 306
DropboxFile
makeDropboxFile(string|DropboxFile $dropboxFile, int $maxLength = -1, int $offset = -1)
Make DropboxFile Object
at line line 334
FileMetadata|FolderMetadata
getMetadata(string $path, array $params = array())
Get the Metadata for a file or folder
at line line 361
MetadataCollection
listFolder(string $path = null, array $params = array())
Get the contents of a Folder
at line line 390
MetadataCollection
listFolderContinue(string $cursor)
Paginate through all files and retrieve updates to the folder, using the cursor retrieved from listFolder or listFolderContinue
at line line 408
string
listFolderLatestCursor(string $path, array $params = array())
Get a cursor for the folder's state.
at line line 445
ModelCollection
listRevisions(string $path, array $params = array())
Get Revisions of a File
at line line 481
SearchResults
search(string $path, string $query, array $params = array())
Search a folder for files/folders
at line line 509
FolderMetadata
createFolder(string $path)
Create a folder at the given path
at line line 535
DeletedMetadata|FileMetadata|FolderMetadata
delete(string $path)
Delete a file or folder at the given path
at line line 558
FileMetadata|FileMetadata|DeletedMetadata
move(string $fromPath, string $toPath)
Move a file or folder to a different location
at line line 582
FileMetadata|FileMetadata|DeletedMetadata
copy(string $fromPath, string $toPath)
Copy a file or folder to a different location
at line line 606
DeletedMetadata|FileMetadata|FolderMetadata
restore(string $path, string $rev)
Restore a file to the specific version
at line line 632
CopyReference
getCopyReference(string $path)
Get Copy Reference
at line line 657
FileMetadata|FolderMetadata
saveCopyReference(string $path, string $copyReference)
Save Copy Reference
at line line 686
TemporaryLink
getTemporaryLink(string $path)
Get a temporary link to stream contents of a file
at line line 710
string
saveUrl(string $path, string $url)
Save a specified URL into a file in user's Dropbox
at line line 739
string|FileMetadata
checkJobStatus($asyncJobId)
Save a specified URL into a file in user's Dropbox
at line line 773
FileMetadata
upload(string|DropboxFile $dropboxFile, string $path, array $params = array())
Upload a File to Dropbox
at line line 799
FileMetadata
simpleUpload(string|DropboxFile $dropboxFile, string $path, array $params = array())
Upload a File to Dropbox in a single request
at line line 827
string
startUploadSession(string|DropboxFile $dropboxFile, int $chunkSize = -1, boolean $close = false)
Start an Upload Session
at line line 865
FileMetadata
finishUploadSession(string|DropboxFile $dropboxFile, string $sessionId, int $offset, int $remaining, string $path, array $params = array())
Finish an upload session and save the uploaded data to the given file path
at line line 909
string
appendUploadSession(string|DropboxFile $dropboxFile, string $sessionId, int $offset, int $chunkSize, boolean $close = false)
Append more data to an Upload Session
at line line 952
string
uploadChunked(string|DropboxFile $dropboxFile, string $path, int $fileSize = null, int $chunkSize = null, array $params = array())
Upload file in sessions/chunks
at line line 1010
protected string
getThumbnailSize(string $size)
Get thumbnail size
at line line 1035
Thumbnail
getThumbnail(string $path, string $size = 'small', string $format = 'jpeg')
Get a thumbnail for an image
at line line 1099
protected array
getMetadataFromResponseHeaders(DropboxResponse $response)
Get metadata from response headers
at line line 1173
AccountList
getAccounts(array $account_ids = array())
Get Multiple Accounts in one call
at line line 1190
array
getSpaceUsage()
Get Space Usage for the current user's account