mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
Added in Libresapi: Handlers to interact with shared files
This commit is contained in:
parent
0ebe885d6f
commit
ef52e090ea
5 changed files with 547 additions and 2 deletions
58
libresapi/src/api/FileSharingHandler.h
Normal file
58
libresapi/src/api/FileSharingHandler.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* libresapi
|
||||
*
|
||||
* Copyright (C) 2017, Konrad Dębiec <konradd@tutanota.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ResourceRouter.h"
|
||||
#include "StateTokenServer.h"
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
|
||||
namespace resource_api
|
||||
{
|
||||
|
||||
class FileSharingHandler: public ResourceRouter
|
||||
{
|
||||
public:
|
||||
FileSharingHandler(StateTokenServer* sts, RsFiles* files);
|
||||
virtual ~FileSharingHandler();
|
||||
|
||||
private:
|
||||
void handleWildcard(Request& req, Response& resp);
|
||||
void handleForceCheck(Request& req, Response& resp);
|
||||
|
||||
void handleGetSharedDir(Request& req, Response& resp);
|
||||
void handleSetSharedDir(Request& req, Response& resp);
|
||||
void handleUpdateSharedDir(Request& req, Response& resp);
|
||||
void handleRemoveSharedDir(Request& req, Response& resp);
|
||||
|
||||
void handleGetDirectoryParent(Request& req, Response& resp);
|
||||
void handleGetDirectoryChilds(Request& req, Response& resp);
|
||||
|
||||
void handleIsDownloadDirShared(Request& req, Response& resp);
|
||||
void handleShareDownloadDirectory(Request& req, Response& resp);
|
||||
|
||||
void handleDownload(Request& req, Response& resp);
|
||||
|
||||
StateToken mStateToken;
|
||||
StateTokenServer* mStateTokenServer;
|
||||
|
||||
RsFiles* mRsFiles;
|
||||
};
|
||||
|
||||
} // namespace resource_api
|
Loading…
Add table
Add a link
Reference in a new issue