|
@@ -11,6 +11,7 @@ JsonCommander::JsonCommander(FileManager &fileManager)
|
|
|
commandsMap["putdata"] = &JsonCommander::executePutdata;
|
|
|
commandsMap["get"] = &JsonCommander::executeGet;
|
|
|
commandsMap["getdata"] = &JsonCommander::executeGetdata;
|
|
|
+ commandsMap["head"] = &JsonCommander::executeHead;
|
|
|
}
|
|
|
|
|
|
JsonCommander::~JsonCommander() {}
|
|
@@ -310,6 +311,21 @@ JsonCommander::executeGetdata(const Json::Value &message) {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
+JsonCommander::Response JsonCommander::executeHead(const Json::Value &message) {
|
|
|
+ JsonCommander::Response response;
|
|
|
+ response.action = send;
|
|
|
+ response.json["command"] = "head";
|
|
|
+
|
|
|
+ if(!message["file"].isString()) {
|
|
|
+ response.json["accept"] = false;
|
|
|
+ response.json["file"] = "";
|
|
|
+ response.json["data"] = "";
|
|
|
+ response.json["error"] = "incorrect heaed command request";
|
|
|
+ }
|
|
|
+
|
|
|
+ return response;
|
|
|
+}
|
|
|
+
|
|
|
JsonCommander::Response JsonCommander::testVersion(const Json::Value &message) {
|
|
|
JsonCommander::Response response;
|
|
|
response.json["version"] = this->protocolVersion;
|