GetLatestVersionRequest::GetLatestVersionRequest(const QString& client_id, const QString& client_version) : SeafileApiRequest(QUrl(kLatestVersionUrl), SeafileApiRequest::METHOD_GET) { setUrlParam("id", client_id.left(8)); setUrlParam("v", QString(kOsName) + "-" + client_version); }
UnstarFileRequest::UnstarFileRequest(const Account &account, const QString &repo_id, const QString &path) : SeafileApiRequest( account.getAbsoluteUrl(kGetStarredFilesUrl), SeafileApiRequest::METHOD_DELETE, account.token) { setUrlParam("repo_id", repo_id); setUrlParam("p", path); }
GetSmartLinkRequest::GetSmartLinkRequest(const Account& account, const QString &repo_id, const QString &path, bool is_dir) : SeafileApiRequest( account.getAbsoluteUrl(QString(kGetSmartLink)), SeafileApiRequest::METHOD_GET, account.token), repo_id_(repo_id), path_(path), is_dir_(is_dir) { setUrlParam("repo_id", repo_id); setUrlParam("path", path); setUrlParam("is_dir", is_dir ? "true" : "false"); }
/** * CreateSubrepoRequest */ CreateSubrepoRequest::CreateSubrepoRequest(const Account& account, const QString& name, const QString& repoid, const QString& path, const QString& passwd) : SeafileApiRequest( account.getAbsoluteUrl(QString(kCreateSubrepoUrl).arg(repoid)), SeafileApiRequest::METHOD_GET, account.token) { setUrlParam(QString("p"), path); setUrlParam(QString("name"), name); if (!passwd.isNull()) { setUrlParam(QString("password"), passwd); } }
GetRepoTokensRequest::GetRepoTokensRequest(const Account& account, const QStringList& repo_ids) : SeafileApiRequest(account.getAbsoluteUrl(kGetRepoTokensUrl), SeafileApiRequest::METHOD_GET, account.token) { setUrlParam("repos", repo_ids.join(",")); }
GetFileUploadedBytesRequest::GetFileUploadedBytesRequest( const Account &account, const QString &repo_id, const QString &parent_dir, const QString &file_name) : SeafileApiRequest( account.getAbsoluteUrl(QString(kGetFileUploadedBytesUrl).arg(repo_id)), SeafileApiRequest::METHOD_GET, account.token), repo_id_(repo_id), parent_dir_(parent_dir), file_name_(file_name) { setUrlParam("parent_dir", parent_dir.startsWith("/") ? parent_dir : "/" + parent_dir); setUrlParam("file_name", file_name); }
GetCommitDetailsRequest::GetCommitDetailsRequest(const Account& account, const QString& repo_id, const QString& commit_id) : SeafileApiRequest (account.getAbsoluteUrl(kCommitDetailsUrl + repo_id + "/"), SeafileApiRequest::METHOD_GET, account.token) { setUrlParam("commit_id", commit_id); }
GetEventsRequest::GetEventsRequest(const Account& account, int start) : SeafileApiRequest (account.getAbsoluteUrl(kGetEventsUrl), SeafileApiRequest::METHOD_GET, account.token) { if (start > 0) { setUrlParam("start", QString::number(start)); } }
GetFileDownloadLinkRequest::GetFileDownloadLinkRequest(const Account &account, const QString &repo_id, const QString &path) : SeafileApiRequest( account.getAbsoluteUrl(QString(kGetFilesUrl).arg(repo_id)), SeafileApiRequest::METHOD_GET, account.token) { setUrlParam("p", path); }
GetDirentsRequest::GetDirentsRequest(const Account& account, const QString& repo_id, const QString& path) : SeafileApiRequest (account.getAbsoluteUrl(QString(kGetDirentsUrl).arg(repo_id)), SeafileApiRequest::METHOD_GET, account.token), repo_id_(repo_id), path_(path), readonly_(false) { setUrlParam("p", path); }
FileSearchRequest::FileSearchRequest(const Account& account, const QString& keyword, int per_page) : SeafileApiRequest(account.getAbsoluteUrl(kFileSearchUrl), SeafileApiRequest::METHOD_GET, account.token), keyword_(keyword) { setUrlParam("q", keyword_); }
GetFileUploadLinkRequest::GetFileUploadLinkRequest(const Account &account, const QString &repo_id, const QString &path, bool use_upload) : SeafileApiRequest( account.getAbsoluteUrl(QString( use_upload ? kGetFileUploadUrl : kGetFileUpdateUrl).arg(repo_id)), SeafileApiRequest::METHOD_GET, account.token) { setUrlParam("p", path); }
CreateDirectoryRequest::CreateDirectoryRequest(const Account &account, const QString &repo_id, const QString &path) : SeafileApiRequest( account.getAbsoluteUrl(QString(kGetDirentsUrl).arg(repo_id)), SeafileApiRequest::METHOD_POST, account.token), repo_id_(repo_id), path_(path) { setUrlParam("p", path); setFormParam("operation", "mkdir"); }
RemoveDirentRequest::RemoveDirentRequest(const Account &account, const QString &repo_id, const QString &path, bool is_file) : SeafileApiRequest( account.getAbsoluteUrl( QString(is_file ? kGetFilesUrl : kGetDirentsUrl).arg(repo_id)), SeafileApiRequest::METHOD_DELETE, account.token), is_file_(is_file), repo_id_(repo_id), path_(path) { setUrlParam("p", path); }
RemoveDirentsRequest::RemoveDirentsRequest(const Account &account, const QString &repo_id, const QString &parent_path, const QStringList& filenames) : SeafileApiRequest( account.getAbsoluteUrl( QString(kRemoveDirentsURL).arg(repo_id)), SeafileApiRequest::METHOD_POST, account.token), repo_id_(repo_id), parent_path_(parent_path), filenames_(filenames) { setUrlParam("p", parent_path_); setFormParam("file_names", filenames_.join(":")); }
MoveFileRequest::MoveFileRequest(const Account &account, const QString &repo_id, const QString &path, const QString &dst_repo_id, const QString &dst_dir_path) : SeafileApiRequest( account.getAbsoluteUrl(QString(kGetFilesUrl).arg(repo_id)), SeafileApiRequest::METHOD_POST, account.token) { setUrlParam("p", path); setFormParam("operation", "move"); setFormParam("dst_repo", dst_repo_id); setFormParam("dst_dir", dst_dir_path); }
RenameDirentRequest::RenameDirentRequest(const Account &account, const QString &repo_id, const QString &path, const QString &new_name, bool is_file) : SeafileApiRequest( account.getAbsoluteUrl( QString(is_file ? kGetFilesUrl: kGetDirentsUrl).arg(repo_id)), SeafileApiRequest::METHOD_POST, account.token), is_file_(is_file), repo_id_(repo_id), path_(path), new_name_(new_name) { setUrlParam("p", path); setFormParam("operation", "rename"); setFormParam("newname", new_name); }
MoveMultipleFilesRequest::MoveMultipleFilesRequest(const Account &account, const QString &repo_id, const QString &src_dir_path, const QStringList &src_file_names, const QString &dst_repo_id, const QString &dst_dir_path) : SeafileApiRequest( account.getAbsoluteUrl(QString(kFileOperationMove).arg(repo_id)), SeafileApiRequest::METHOD_POST, account.token), repo_id_(repo_id), src_dir_path_(src_dir_path), src_file_names_(src_file_names) { setUrlParam("p", src_dir_path); setFormParam("file_names", src_file_names.join(":")); setFormParam("dst_repo", dst_repo_id); setFormParam("dst_dir", dst_dir_path); }
GetIndexProgressRequest::GetIndexProgressRequest(const QUrl &url, const QString &task_id) : SeafileApiRequest(url, SeafileApiRequest::METHOD_GET) { setUrlParam("task_id", task_id); }