Files
DbWebserver-fileserverplugin/fileserverapplication.h

30 lines
577 B
C
Raw Permalink Normal View History

2018-09-17 19:22:53 +02:00
#pragma once
#include "webapplication.h"
2018-10-04 23:32:24 +02:00
#include <QDir>
2018-09-17 19:22:53 +02:00
class QJsonObject;
class WebServer;
2018-09-17 19:22:53 +02:00
class FileserverApplication : public WebApplication
{
Q_OBJECT
2018-10-04 23:32:24 +02:00
static const QString SERVER_NAME;
static const QDir PLUGIN_RESOURCES_DIR;
2018-09-17 19:22:53 +02:00
public:
FileserverApplication(const QJsonObject &config, WebServer &webServer);
2018-09-17 19:22:53 +02:00
void start() Q_DECL_OVERRIDE;
2018-09-22 03:07:20 +02:00
void handleRequest(HttpClientConnection *connection, const HttpRequest &request) Q_DECL_OVERRIDE;
private:
2018-10-04 23:32:24 +02:00
static QString formatSize(qint64 size);
WebServer &m_webServer;
2018-10-04 23:32:24 +02:00
QDir m_rootPath;
2018-09-17 19:22:53 +02:00
};