diff --git a/app/src/main/java/lightcontainer/protocol/ClientFileList.java b/app/src/main/java/lightcontainer/protocol/ClientFileList.java new file mode 100644 index 0000000..c88f72f --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientFileList.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class ClientFileList extends Protocol{ + protected ClientFileList() { + super("FILELIST", "^FILELIST\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientGetFile.java b/app/src/main/java/lightcontainer/protocol/ClientGetFile.java new file mode 100644 index 0000000..4b0fa24 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientGetFile.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class ClientGetFile extends Protocol{ + protected ClientGetFile() { + super("GETFILE","^GETFILE ([^ !]{1,20})\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientRemoveFile.java b/app/src/main/java/lightcontainer/protocol/ClientRemoveFile.java new file mode 100644 index 0000000..dd5375b --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientRemoveFile.java @@ -0,0 +1,13 @@ +package lightcontainer.protocol; + +public class ClientRemoveFile extends Protocol{ + + protected ClientRemoveFile() { + super("REMOVEFILE", "^REMOVEFILE ([^ !]{1,20})\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientSaveFile.java b/app/src/main/java/lightcontainer/protocol/ClientSaveFile.java new file mode 100644 index 0000000..a3b7b11 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientSaveFile.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class ClientSaveFile extends Protocol { + protected ClientSaveFile() { + super("SAVEFILE", "^SAVE_FILE ([^ !]{1,20}) ([0-9]{1,10})\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientSignIn.java b/app/src/main/java/lightcontainer/protocol/ClientSignIn.java new file mode 100644 index 0000000..43edf56 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientSignIn.java @@ -0,0 +1,13 @@ +package lightcontainer.protocol; + +public class ClientSignIn extends Protocol { + + protected ClientSignIn() { + super("SIGNIN", "^(SIGNIN) ([A-Za-z0-9]{2,20}) ([^ !]{5,50})\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientSignOut.java b/app/src/main/java/lightcontainer/protocol/ClientSignOut.java new file mode 100644 index 0000000..909b047 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientSignOut.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class ClientSignOut extends Protocol { + protected ClientSignOut() { + super("SIGNOUT", "^SIGNOUT\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/ClientSignUp.java b/app/src/main/java/lightcontainer/protocol/ClientSignUp.java new file mode 100644 index 0000000..91c67d3 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/ClientSignUp.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class ClientSignUp extends Protocol{ + protected ClientSignUp() { + super("SIGNUP","^(SIGNUP) ([A-Za-z0-9]{2,20}) ([^ !]{5,50})\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/SbeEraseResult.java b/app/src/main/java/lightcontainer/protocol/SbeEraseResult.java new file mode 100644 index 0000000..301edd8 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/SbeEraseResult.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class SbeEraseResult extends Protocol { + protected SbeEraseResult() { + super("ERASERESULT", "^(ERASE_OK|ERASE_ERROR)\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/SbeHello.java b/app/src/main/java/lightcontainer/protocol/SbeHello.java index af30e5b..6cd750a 100644 --- a/app/src/main/java/lightcontainer/protocol/SbeHello.java +++ b/app/src/main/java/lightcontainer/protocol/SbeHello.java @@ -4,7 +4,7 @@ public class SbeHello extends Protocol { protected SbeHello() { - super("HELLO", "^(HELLO)\\s([A-Za-z0-9.]{5,20})\\s((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([0-5][0-9]{4})|([0-9]{1,4}))\\r\\n$"); + super("HELLO", "^(HELLO) ([A-Za-z0-9.]{5,20}) ([\\d]{0,5})\r\n$"); } @Override diff --git a/app/src/main/java/lightcontainer/protocol/SbeRetrieveResult.java b/app/src/main/java/lightcontainer/protocol/SbeRetrieveResult.java new file mode 100644 index 0000000..091cca2 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/SbeRetrieveResult.java @@ -0,0 +1,12 @@ +package lightcontainer.protocol; + +public class SbeRetrieveResult extends Protocol { + protected SbeRetrieveResult() { + super("RETTRIEVERESULT", "^((RETRIEVE_OK) ([A-Za-z0-9.]{50,200} [0-9]{1,10} [A-Za-z0-9.]{50,200})\r\n)|((RETRIEVE_ERROR)\r\n)$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/java/lightcontainer/protocol/SbeSendResult.java b/app/src/main/java/lightcontainer/protocol/SbeSendResult.java new file mode 100644 index 0000000..48279e1 --- /dev/null +++ b/app/src/main/java/lightcontainer/protocol/SbeSendResult.java @@ -0,0 +1,13 @@ +package lightcontainer.protocol; + +public class SbeSendResult extends Protocol { + + protected SbeSendResult() { + super("SENDRESULT", "^(SEND_OK|SEND_ERROR)\r\n$"); + } + + @Override + public void execute(String cmd) { + + } +} diff --git a/app/src/main/resources/rules.txt b/app/src/main/resources/rules.txt index 511bc2b..e5d69af 100644 --- a/app/src/main/resources/rules.txt +++ b/app/src/main/resources/rules.txt @@ -4,40 +4,40 @@ port = (6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9 size = [0-9]{1,10} line = \r\n visiblechar = \p{Print} -passchar = [^\s!] +passchar = [^ !] binary = . -password = [^\s!]{5,50} -bl = \s +password = [^ !]{5,50} +bl = //espace letter = [A-Za-z] digit_letter = [A-Za-z0-9] -filename = [^\s!]{1,20} +filename = [^ !]{1,20} domain = [A-Za-z0-9.]{5,20} hash_filename = [A-Za-z0-9.]{50,200} hash_filecontent = [A-Za-z0-9.]{50,200} -file_info = [A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200} +file_info = [A-Za-z0-9.]{50,200} [0-9]{1,10} [A-Za-z0-9.]{50,200} login = [A-Za-z0-9]{2,20} //StorBackEnd to FileFrontEnd -sbe_hello = ^(HELLO)\s([A-Za-z0-9.]{5,20})\s((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([0-5][0-9]{4})|([0-9]{1,4}))\r\n$ //TODO \r\n -> à tester pour voir si déjà dans le flux ou doit être construit +sbe_hello = ^HELLO ([A-Za-z0-9.]{5,20}) ([\d]{0,5})\r\n$ //TODO \r\n -> à tester pour voir si déjà dans le flux ou doit être construit //FileFrontEnd to StorBackEnd -ffe_sendfile = ^(SENDFILE)\s([A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200})\r\n$ +ffe_sendfile = ^SENDFILE ([A-Za-z0-9.]{50,200} [0-9]{1,10} [A-Za-z0-9.]{50,200})\r\n$ sbe_sendresult = ^(SEND_OK|SEND_ERROR)\r\n$ -ffe_erasefile = ^(ERASEFILE)\s([A-Za-z0-9.]{50,200})\r\n$ +ffe_erasefile = ^ERASEFILE ([A-Za-z0-9.]{50,200})\r\n$ sbe_eraseresult = ^(ERASE_OK|ERASE_ERROR)\r\n$ -ffe_retrievefile = ^(RETRIEVEFILE)\s([A-Za-z0-9.]{50,200})\r\n$ -sbe_retrieveresult = ^((RETRIEVE_OK)\s([A-Za-z0-9.]{50,200}\s[0-9]{1,10}\s[A-Za-z0-9.]{50,200})\r\n)|((RETRIEVE_ERROR)\r\n)$ +ffe_retrievefile = ^RETRIEVEFILE ([A-Za-z0-9.]{50,200})\r\n$ +sbe_retrieveresult = ^(RETRIEVE_OK ([A-Za-z0-9.]{50,200} [0-9]{1,10} [A-Za-z0-9.]{50,200})\r\n)|(RETRIEVE_ERROR\r\n)$ //Client to FileFrontEnd -client_signin = ^(SIGNIN)\s([A-Za-z0-9]{2,20})\s([^\s!]{5,50})\r\n$ -client_signup = ^(SIGNUP)\s([A-Za-z0-9]{2,20})\s([^\s!]{5,50})\r\n$ +client_signin = ^SIGNIN ([A-Za-z0-9]{2,20}) ([^ !]{5,50})\r\n$ +client_signup = ^SIGNUP ([A-Za-z0-9]{2,20}) ([^ !]{5,50})\r\n$ ffe_signresult = ^(SIGN_OK|SIGN_ERROR)\r\n$ -client_filelist = ^(FILELIST)\r\n$ -ffe_filelistresult = ^(FILES)\s(([^\s!]{1,20}![0-9]{1,10}){0,50})\r\n$ -client_savefile = ^(SAVE_FILE)\s([^\s!]{1,20})\s([0-9]{1,10})\r\n$ +client_filelist = ^FILELIST\r\n$ +ffe_filelistresult = ^FILES(( [^ !]{1,20})!([0-9]{1,10})){0,50}$ +client_savefile = ^SAVE_FILE ([^ !]{1,20}) ([0-9]{1,10})\r\n$ ffe_savefileresult = ^(SAVEFILE_OK|SAVEFILE_ERROR)\r\n$ -client_getfile = ^(GETFILE)\s([^\s!]{1,20})\r\n$ -ffe_getfileresult = ^((GETFILE_OK)\s(^\s!]{1,20})\s([0-9]{1,10})\r\n)|((GETFILE_ERROR)\r\n)$ -client_removefile = ^(REMOVEFILE)\s([^\s!]{1,20})\r\n$ +client_getfile = ^GETFILE ([^ !]{1,20})\r\n$ +ffe_getfileresult = ^(GETFILE_OK (^ !]{1,20}) ([0-9]{1,10})\r\n)|(GETFILE_ERROR\r\n)$ +client_removefile = ^REMOVEFILE ([^ !]{1,20})\r\n$ ffe_removefileresult = ^(REMOVEFILE_OK|REMOVEFILE_ERROR)\r\n$ -client_signout = ^(SIGNOUT)\r\n$ \ No newline at end of file +client_signout = ^SIGNOUT\r\n$ \ No newline at end of file