From fdcccc178892e2ef94ecb08559a4afdbc9075ea2 Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sat, 19 Mar 2022 12:48:00 +0100 Subject: [PATCH] =?UTF-8?q?Nouvelles=20Regex=20:=20CLIENT=5FGET=5FFILE=20v?= =?UTF-8?q?alid=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protocol/rules/reader/GetFileRule.java | 6 ++++- app/src/main/resources/appdata.json | 27 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/lightcontainer/protocol/rules/reader/GetFileRule.java b/app/src/main/java/lightcontainer/protocol/rules/reader/GetFileRule.java index 116fb6d..12d5a45 100644 --- a/app/src/main/java/lightcontainer/protocol/rules/reader/GetFileRule.java +++ b/app/src/main/java/lightcontainer/protocol/rules/reader/GetFileRule.java @@ -3,15 +3,19 @@ package lightcontainer.protocol.rules.reader; import lightcontainer.domains.client.Context; import lightcontainer.interfaces.ProtocolRepository; import lightcontainer.protocol.ProtocolReader; +import lightcontainer.protocol.StandardizedDefinitions; import lightcontainer.protocol.rules.writer.GetFileErrorRule; import lightcontainer.protocol.rules.writer.RetrieveFileRule; import lightcontainer.storage.ReadOnlyFile; import java.util.Iterator; +import static lightcontainer.protocol.StandardizedDefinitions.CLIENT_GET_FILE; + public class GetFileRule extends ProtocolReader { // Constants - private static final String PATTERN = "^GETFILE ([^ !]{1,20})\r\n$"; + //"^GETFILE ([^ !]{1,20})\r\n$" + private static final String PATTERN = CLIENT_GET_FILE; private static final String NAME = "GETFILE"; // -- arguments private static final int FILE_NAME = 0; // Index file name. diff --git a/app/src/main/resources/appdata.json b/app/src/main/resources/appdata.json index e3bd969..5be4580 100644 --- a/app/src/main/resources/appdata.json +++ b/app/src/main/resources/appdata.json @@ -1 +1,26 @@ -{"unicast_port":8000,"multicast_ip":"224.66.66.1","multicast_port":15502,"network_interface":"lo","tls":true,"storagePath":"C:\\Users\\ledou\\Documents\\ffe","users":[{"name":"aaaaa","password":"$2a$10$Tuh5xmGEy0g26hQO1SHNY.TNy8rY9VCkpzRLP3rlpnVHtwYew4.km","aes_key":"a68CqbWmmf0cuvgvMhm9OC+Y24ut3DY/0WBqtd3nGfU=","files":[{"name":"test.txt","fileNameSalt":"3yLVBqM/zf8CcCFPqdh15Q==","size":301,"iv":"WfokhcAIefnnZnk3sYLjiA==","storage":["lightcontainerSB01"]}]}]} \ No newline at end of file +{ + "unicast_port": 8000, + "multicast_ip": "224.66.66.1", + "multicast_port": 15502, + "network_interface": "lo", + "tls": true, + "storagePath": "C:\\Users\\ledou\\Documents\\ffe", + "users": [ + { + "name": "aaaaa", + "password": "$2a$10$Tuh5xmGEy0g26hQO1SHNY.TNy8rY9VCkpzRLP3rlpnVHtwYew4.km", + "aes_key": "a68CqbWmmf0cuvgvMhm9OC+Y24ut3DY/0WBqtd3nGfU=", + "files": [ + { + "name": "test.txt", + "fileNameSalt": "3yLVBqM/zf8CcCFPqdh15Q==", + "size": 301, + "iv": "WfokhcAIefnnZnk3sYLjiA==", + "storage": [ + "lightcontainerSB01" + ] + } + ] + } + ] +} \ No newline at end of file