George Fedoseev

Go to Tutorial

DropboxSync v3.0 Documentation

Logo

Contents

 

Downloading

GetFileAsLocalCachedPath()

Asynchronously retrieves file from Dropbox and returns path to local filesystem cached copy.

Parameters

ParameterDescription
dropboxPathPath to file on Dropbox
progressCallbackProgress callback with download percentage and speed
successCallbackCallback for receiving downloaded file path
errorCallbackCallback that is triggered if any exception happened
useCachedFirstServe cached version (if it exists) before event checking Dropbox for newer version?
useCachedIfOfflineUse cached version if no Internet connection?
receiveUpdatesIf true, then when there are remote updates on Dropbox, callback function successCallback will be triggered again with updated version of the file.
cancellationTokenCancellation token that can be used to cancel download

 

Example usage

Example usage (async)

 

GetFileAsBytes()

Asynchronously retrieves file from Dropbox and returns it as byte array

Parameters

ParameterDescription
dropboxPathPath to file on Dropbox
progressCallbackProgress callback with download percentage and speed
successCallbackCallback for receiving downloaded file bytes
errorCallbackCallback that is triggered if any exception happened
useCachedFirstServe cached version (if it exists) before event checking Dropbox for newer version?
useCachedIfOfflineUse cached version if no Internet connection?
receiveUpdatesIf true, then when there are remote updates on Dropbox, callback function successCallback will be triggered again with updated version of the file.
cancellationTokenCancellation token that can be used to cancel download

 

GetFile<T>()

Retrieves file from Dropbox and returns it as T (T can be string, Texture2D or any type that can be deserialized from text using JsonUtility)

Parameters

ParameterDescription
dropboxPathPath to file on Dropbox
progressCallbackProgress callback with download percentage and speed
successCallbackCallback for receiving downloaded object T (T can be string, Texture2D or any type that can be deserialized from text using JsonUtility)
errorCallbackCallback that is triggered if any exception happened
useCachedFirstServe cached version (if it exists) before event checking Dropbox for newer version?
useCachedIfOfflineUse cached version if no Internet connection?
receiveUpdatesIf true, then when there are remote updates on Dropbox, callback function successCallback will be triggered again with updated version of the file.
cancellationTokenCancellation token that can be used to cancel download

Example usage

 

Uploading

UploadFile(string localFilePath)

Uploads file from specified filepath in local filesystem to Dropbox

Parameters

ParameterDescription
localFilePathPath to local file
dropboxPathUpload path on Dropbox
progressCallbackProgress callback with upload percentage and speed
successCallbackCallback for receiving uploaded file Metadata
errorCallbackCallback that is triggered if any exception happened
cancellationTokenCancellation token that can be used to cancel the upload

 

Example usage

Example usage (async)

 

UploadFile(byte[] bytes)

Uploads byte array to Dropbox

Parameters

ParameterDescription
bytesBytes to upload
dropboxPathUpload path on Dropbox
progressCallbackProgress callback with upload percentage and speed
successCallbackCallback for receiving uploaded file Metadata
errorCallbackCallback that is triggered if any exception happened
cancellationTokenCancellation token that can be used to cancel the upload

 

Keeping in Sync

NOTE: Synchronization is only one way: Dropbox to Local cache

 

KeepSynced()

Keep Dropbox file or folder synced (one-way: from Dropbox to Local cache)

Parameters

ParameterDescription
dropboxPathFile or folder path on Dropbox
syncedCallbackCallback that is triggered after change is synced from Dropbox

Example usage

 

UnsubscribeFromKeepSyncCallback()

Unsubscribe specified callback from getting synced changes (if there will be no callbacks listening then syncing will automatically stop as well)

Parameters

ParameterDescription
dropboxPathFile or folder path on Dropbox
syncedCallbackCallback that you wish to unsubscribe

 

StopKeepingInSync()

Stop keeping in sync Dropbox file or folder

Parameters

ParameterDescription
dropboxPathFile or folder path on Dropbox

 

IsKeepingInSync()

Checks if currently keeping Dropbox file of folder in sync

Parameters

ParameterDescription
dropboxPathFile or folder path on Dropbox

 

Operations

 

CreateFolder()

Creates folder on Dropbox

Parameters

ParameterDescription
dropboxFolderPathFolder to create
successCallbackCallback for receiving created folder Metadata
errorCallbackCallback for receiving exceptions
autorenameShould autorename if conflicting paths?

 

ListFolder()

Get contents of the folder on Dropbox

Parameters

ParameterDescription
dropboxFolderPathPath to folder on Dropbox
successCallbackCallback for receiving a List of file's and folder's Metadata - contents on the folder
errorCallbackCallback for receiving exceptions
recursiveInclude all subdirectories recursively?

 

Move()

Move file or folder from one path to another

Parameters

ParameterDescription
fromDropboxPathFrom where to move
toDropboxPathWhere to move
successCallbackCallback for receiving moved object Metadata
errorCallbackCallback for receiving exceptions
autorenameShould autorename if conflicting paths?

 

Delete()

Delete file or folder on Dropbox

Parameters

ParameterDescription
dropboxPathPath to delete
successCallbackCallback for receiving deleted object Metadata
errorCallbackCallback for receiving exceptions

 

PathExists()

Checks if file or folder exists on Dropbox

Parameters

ParameterDescription
dropboxPathPath to file or folder
successCallbackCallback for receiving boolean result
errorCallbackCallback for receiving exceptions

 

GetMetadata()

Get Metadata for file or folder on Dropbox

Parameters

ParameterDescription
dropboxPathPath to file or folder
successCallbackCallback for receiving file's or folder's Metadata
errorCallbackCallback for receiving exceptions

 

ShouldUpdateFileFromDropbox()

Checks if Dropbox has different version of the file (always returns true if file is not cached locally)

Parameters

ParameterDescription
dropboxFilePathPath to file on Dropbox
successCallbackCallback for receiving boolean result
errorCallbackCallback for receiving exceptions