Dropbox
The Dropbox classes implement the abstract job interface to allow accessing files and folders stored on Dropbox. Besides the interface defined by the SynqClient::AbstractJob as well as the abstract job base classes, all Dropbox related jobs also implement the SynqClient::AbstractDropboxJob interface. This interface defines the shared properties of all Dropbox related functionality.
General Notes
The Dropbox job classes map like this to the library:
The rev property as provided by Dropbox is mapped to the sync attribute (see e.g.
SynqClient::FileInfo).No additional custom properties are used in
SynqClient::FileInfo.
Warnings
Please consider the following hints when working with the Dropbox jobs:
The Dropbox jobs use an OAuth2 bearer token to identify the user. The library itself does not provide any functionality to acquire such a token. For testing purposes, you can create a token in the Dropbox app console for your app. For productive use, you will want to acquire a token by running through the appropriate OAuth2 flow. Qt provides OAuth support via the Qt Network Authorization module.
AbstractDropboxJob
-
class AbstractDropboxJob
Shared interface for all Dropbox related jobs.
This class provides the shared interface that all Dropbox jobs require.
Subclassed by SynqClient::DropboxCreateDirectoryJob, SynqClient::DropboxDeleteJob, SynqClient::DropboxDownloadFileJob, SynqClient::DropboxGetFileInfoJob, SynqClient::DropboxListFilesJob, SynqClient::DropboxUploadFileJob
Public Functions
-
AbstractDropboxJob()
Constructor.
-
virtual ~AbstractDropboxJob()
Destructor.
-
QNetworkAccessManager *networkAccessManager() const
The network access manager used by the job.
-
void setNetworkAccessManager(QNetworkAccessManager *networkAccessManager)
Set the
networkAccessManagerto be used by the job.
-
QString userAgent() const
The user agent used when making network requests.
-
void setUserAgent(const QString &userAgent)
Set the
userAgentto be used when making network requests.
-
QString token() const
The OAuth2 bearer token used to authenticate against the Dropbox API.
-
void setToken(const QString &token)
Set the OAuth2 bearer
tokento be used to authenticate against the Dropbox API.
Public Static Attributes
-
static const QString DropboxFileInfoKey = "Dropbox"
The key used to store retrieved file or folder metadata in a FileInfo object.
This key is used to store the original JSON metadata of a file or folder as retrieved by the Dropbox API in a FileInfo object (via FileInfo::setCustomProperty()).
Protected Functions
-
explicit AbstractDropboxJob(AbstractDropboxJobPrivate *d)
Constructor.
-
AbstractDropboxJob()
DropboxGetFileInfoJob
-
class DropboxGetFileInfoJob : public SynqClient::GetFileInfoJob, public SynqClient::AbstractDropboxJob
Implementation of the GetFileInfoJob for Dropbox.
This class implements the abstract GetFileInfoJob class for Dropbox. It behaves specially in the following aspects:
No information for the root directory can be retrieved. Trying so will result in an error. See https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata.
Public Functions
-
explicit DropboxGetFileInfoJob(QObject *parent = nullptr)
Constructor.
-
~DropboxGetFileInfoJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxGetFileInfoJob(DropboxGetFileInfoJobPrivate *d, QObject *parent = nullptr)
Constructor.
DropboxListFilesJob
-
class DropboxListFilesJob : public SynqClient::ListFilesJob, public SynqClient::AbstractDropboxJob
Implementation of the ListFilesJob for Dropbox.
This class implements the ListFilesJob for Dropbox. The Dropbox implementation has the following additional capabilities:
Folders can be listed recursively.
The implementation supports cursors, which allow to efficiently get updates inside a remote folder.
Public Functions
-
explicit DropboxListFilesJob(QObject *parent = nullptr)
Constructor.
-
~DropboxListFilesJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxListFilesJob(DropboxListFilesJobPrivate *d, QObject *parent = nullptr)
Constructor.
DropboxCreateDirectoryJob
-
class DropboxCreateDirectoryJob : public SynqClient::CreateDirectoryJob, public SynqClient::AbstractDropboxJob
Implementation of the CreateDirectoryJob for Dropbox.
The Dropbox implementation of this job class differs in the following points from the defined interface:
Recursive Folder Creation: Multiple folders can be created recursively in one command.
Public Functions
-
explicit DropboxCreateDirectoryJob(QObject *parent = nullptr)
Constructor.
-
~DropboxCreateDirectoryJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxCreateDirectoryJob(DropboxCreateDirectoryJobPrivate *d, QObject *parent = nullptr)
Constructor.
DropboxUploadFileJob
-
class DropboxUploadFileJob : public SynqClient::UploadFileJob, public SynqClient::AbstractDropboxJob
Implementation of the UploadFileJob for Dropbox.
This class implements the abstract UploadFileJob class for Dropbox. It behaves specially in the following aspects:
Currently, only files up to 150MB can be uploaded. This is because the job currently only uses the
/files/uploadendpoint. See https://www.dropbox.com/developers/documentation/http/documentation#files-upload for some more details.
Public Functions
-
explicit DropboxUploadFileJob(QObject *parent = nullptr)
Constructor.
-
~DropboxUploadFileJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxUploadFileJob(DropboxUploadFileJobPrivate *d, QObject *parent = nullptr)
Constructor.
DropboxDownloadFileJob
-
class DropboxDownloadFileJob : public SynqClient::DownloadFileJob, public SynqClient::AbstractDropboxJob
Implementation of the DownloadFileJob for Dropbox.
Public Functions
-
explicit DropboxDownloadFileJob(QObject *parent = nullptr)
Constructor.
-
~DropboxDownloadFileJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxDownloadFileJob(DropboxDownloadFileJobPrivate *d, QObject *parent = nullptr)
Destructor.
-
explicit DropboxDownloadFileJob(QObject *parent = nullptr)
DropboxDeleteJob
-
class DropboxDeleteJob : public SynqClient::DeleteJob, public SynqClient::AbstractDropboxJob
Implementation of the DeleteJob for Dropbox.
Public Functions
-
explicit DropboxDeleteJob(QObject *parent = nullptr)
Constructor.
-
~DropboxDeleteJob() override
Destructor.
-
virtual void start() override
Implementation of AbstractJob::start().
-
virtual void stop() override
Implementation of AbstractJob::stop().
Protected Functions
-
explicit DropboxDeleteJob(DropboxDeleteJobPrivate *d, QObject *parent = nullptr)
Constructor.
-
explicit DropboxDeleteJob(QObject *parent = nullptr)