Regex : corrigées

This commit is contained in:
Maximilien LEDOUX 2022-03-15 12:31:09 +01:00
parent cf0c0520b7
commit a72d9db309

View File

@ -15,7 +15,7 @@ public class StandardizedDefinitions {
private final static String PASSWORD = PASSCHAR + "{5,50}";
private final static String BL = "\\x20";
private final static String FILENAME = PASSCHAR + "{1,20}";
private final static String DOMAIN = DIGIT_LETTER + "{5,20}[.]";
private final static String DOMAIN = "[a-z-A-Z0-9\\.]{5,20}";
private final static String HASH_FILENAME = DIGIT_LETTER + "{50,200}";
private final static String HASH_FILECONTENT = DIGIT_LETTER + "{50,200}";
private final static String FILE_INFO = HASH_FILENAME + BL + SIZE + BL + HASH_FILECONTENT;
@ -23,34 +23,34 @@ public class StandardizedDefinitions {
//Regex à utiliser dans les différents protocoles.
//SBE s'annonce à FFE.
public final static String SBE_HELLO = "HELLO" + BL + "(" + DOMAIN + ")" + BL + "(" + PORT + ")" + LINE;
public final static String SBE_HELLO = "^HELLO" + BL + "(" + DOMAIN + ")" + BL + "(" + PORT + ")" + LINE + "$";
//FFE demande à SBE une tâche. SBE répond à FFE.
public final static String FFE_SENDFILE = "SENDFILE" + BL + FILE_INFO + LINE;
public final static String SBE_SEND_RESULT_OK = "SEND_OK" + LINE;
public final static String SBE_SEND_RESULT_ERROR = "SEND_ERROR" + LINE;
public final static String FFE_ERASE_FILE = "ERASEFILE" + BL + HASH_FILENAME + LINE;
public final static String SBE_ERASE_RESULT_OK = "ERASE_OK" + LINE;
public final static String SBE_ERASE_RESULT_ERROR = "ERASE_ERROR" + LINE;
public final static String FFE_RETRIEVE_FILE = "RETRIEVEFILE" + BL + HASH_FILENAME + LINE;
public final static String SBE_RETRIEVE_RESULT_OK = "RETRIEVE_OK" + BL + "(" + FILE_INFO + ")" + LINE;
public final static String SBE_RETRIEVE_RESULT_ERROR = "RETRIEVE_ERROR" + LINE;
public final static String FFE_SENDFILE = "^SENDFILE" + BL + FILE_INFO + LINE + "$";
public final static String SBE_SEND_RESULT_OK = "^SEND_OK" + LINE + "$";
public final static String SBE_SEND_RESULT_ERROR = "^SEND_ERROR" + LINE + "$";
public final static String FFE_ERASE_FILE = "^ERASEFILE" + BL + HASH_FILENAME + LINE + "$";
public final static String SBE_ERASE_RESULT_OK = "^ERASE_OK" + LINE + "$";
public final static String SBE_ERASE_RESULT_ERROR = "^ERASE_ERROR" + LINE + "$";
public final static String FFE_RETRIEVE_FILE = "^RETRIEVEFILE" + BL + HASH_FILENAME + LINE + "$";
public final static String SBE_RETRIEVE_RESULT_OK = "^RETRIEVE_OK" + BL + "(" + FILE_INFO + ")" + LINE + "$";
public final static String SBE_RETRIEVE_RESULT_ERROR = "^RETRIEVE_ERROR" + LINE + "$";
//Client demande à FFE une tâche. FFE répond à client.
public final static String CLIENT_SIGN_IN = "SIGNIN" + BL + "(" + LOGIN + ")" + BL + "(" + PASSWORD + ")" + LINE;
public final static String CLIENT_SIGN_UP = "SIGNUP" + BL + "(" + LOGIN + ")" + BL + "(" + PASSWORD + ")" + LINE;
public final static String FFE_SIGN_OK = "SIGN_OK" + LINE;
public final static String FFE_SIGN_ERROR = "SIGN_ERROR" + LINE;
public final static String CLIENT_FILE_LIST = "FILELIST" + LINE;
public final static String FFE_FILE_LIST_RESULT = "FILES" + "((" + PASSCHAR + "{1,20})!(" + DIGIT + "{1,10})){0,50}" + LINE;
public final static String CLIENT_SAVE_FILE = "SAVEFILE" + BL + "(" + FILENAME + ")" + BL + "(" + SIZE + ")" + LINE;
public final static String FFE_SAVE_FILE_OK = "SAVEFILE_OK" + LINE;
public final static String FFE_SAVE_FILE_ERROR = "SAVEFILE_ERROR" + LINE;
public final static String CLIENT_GET_FILE = "GETFILE" + BL + "(" + FILENAME + ")" + LINE;
public final static String FFE_GET_FILE_RESULT_OK = "GETFILE_OK" + BL + FILENAME + BL + SIZE + LINE;
public final static String FFE_GET_FILE_RESULT_ERROR = "GETFILE_ERROR" + LINE;
public final static String CLIENT_REMOVE_FILE = "REMOVEFILE" + BL + "(" + FILENAME + ")" + LINE;
public final static String FFE_REMOVE_OK = "REMOVEFILE_OK" + LINE;
public final static String FFE_REMOVE_ERROR = "REMOVEFILE_ERROR" + LINE;
public final static String CLIENT_SIGN_OUT = "SIGNOUT" + LINE;
public final static String CLIENT_SIGN_IN = "^SIGNIN" + BL + "(" + LOGIN + ")" + BL + "(" + PASSWORD + ")" + LINE + "$";
public final static String CLIENT_SIGN_UP = "^SIGNUP" + BL + "(" + LOGIN + ")" + BL + "(" + PASSWORD + ")" + LINE + "$";
public final static String FFE_SIGN_OK = "^SIGN_OK" + LINE + "$";
public final static String FFE_SIGN_ERROR = "^SIGN_ERROR" + LINE + "$";
public final static String CLIENT_FILE_LIST = "^FILELIST" + LINE + "$";
public final static String FFE_FILE_LIST_RESULT = "^FILES" + "((" + PASSCHAR + "{1,20})!(" + DIGIT + "{1,10})){0,50}" + LINE + "$";
public final static String CLIENT_SAVE_FILE = "^SAVEFILE" + BL + "(" + FILENAME + ")" + BL + "(" + SIZE + ")" + LINE + "$";
public final static String FFE_SAVE_FILE_OK = "^SAVEFILE_OK" + LINE + "$";
public final static String FFE_SAVE_FILE_ERROR = "^SAVEFILE_ERROR" + LINE + "$";
public final static String CLIENT_GET_FILE = "^GETFILE" + BL + "(" + FILENAME + ")" + LINE + "$";
public final static String FFE_GET_FILE_RESULT_OK = "^GETFILE_OK" + BL + FILENAME + BL + SIZE + LINE + "$";
public final static String FFE_GET_FILE_RESULT_ERROR = "^GETFILE_ERROR" + LINE + "$";
public final static String CLIENT_REMOVE_FILE = "^REMOVEFILE" + BL + "(" + FILENAME + ")" + LINE + "$";
public final static String FFE_REMOVE_OK = "^REMOVEFILE_OK" + LINE + "$";
public final static String FFE_REMOVE_ERROR = "^REMOVEFILE_ERROR" + LINE + "$";
public final static String CLIENT_SIGN_OUT = "^SIGNOUT" + LINE + "$";
}