Class RCC
java.lang.Object
RCC
RCC (Remote Cloud Client) is a client that connects to a server to send, receive, list and execute files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkClientArgs
(String[] arguments) Checks the arguments introduced by the user.static void
Checks that the "clients" folder exists, if not, then creates it.static void
Checks if the "logs" folder exists, if not, then creates it.static void
ExecPetition
(String petition, OutputStream out, InputStream in, String[] petitionTokens) Executes a petition in the server.static void
ExitPetition
(String petition, OutputStream out, Socket clientSocket) Sends the "EXIT" petition to the server.static void
ListPetition
(String petition, OutputStream out, InputStream in, String[] petitionTokens) Lists the files in the server directory requested by the client.static void
Main method of the client.static void
ReceivePetition
(String petition, OutputStream out, InputStream in, String[] petitionTokens) Receives a file from the server.static void
Runs a "normal" client.static void
runPetitions
(Socket clientSocket) Runs the petitions of the client.static void
Runs the "SSL" client mode.static void
SendPetition
(String petition, OutputStream out, InputStream in, String[] petitionTokens) Sends a petition to the server.static void
Shows the options available for the client.static void
Starts the client bifurcating between the "normal" and "ssl" modes.static void
Initializes the logger for the client.
-
Constructor Details
-
RCC
public RCC()
-
-
Method Details
-
main
Main method of the client.- Parameters:
args
- Arguments introduced by the user.
-
checkClientArgs
Checks the arguments introduced by the user.- Parameters:
arguments
- Arguments introduced by the user.
-
startClient
public static void startClient()Starts the client bifurcating between the "normal" and "ssl" modes. -
runNormalClient
public static void runNormalClient()Runs a "normal" client. -
runSSLClient
public static void runSSLClient()Runs the "SSL" client mode. -
runPetitions
Runs the petitions of the client.- Parameters:
clientSocket
- The client's socket.
-
ListPetition
public static void ListPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Lists the files in the server directory requested by the client.- Parameters:
petition
- The petition received from the client.out
- The output stream to send the petition.in
- The input stream to receive the response.petitionTokens
- The tokens of the petition.
-
SendPetition
public static void SendPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Sends a petition to the server.- Parameters:
petition
- The petition to be sent.out
- The output stream to send the petition.in
- The input stream to receive the response.petitionTokens
- The tokens of the petition.
-
ReceivePetition
public static void ReceivePetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Receives a file from the server.- Parameters:
petition
- The petition to be sent.out
- The output stream to send the petition.in
- The input stream to receive the response.petitionTokens
- The tokens of the petition.
-
ExecPetition
public static void ExecPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Executes a petition in the server.- Parameters:
petition
- The petition to be sent.out
- The output stream to send the petition.in
- The input stream to receive the response.petitionTokens
- The tokens of the petition.
-
ExitPetition
Sends the "EXIT" petition to the server.- Parameters:
petition
-out
-clientSocket
-
-
startLogger
public static void startLogger()Initializes the logger for the client. -
checkLogsFolder
public static void checkLogsFolder()Checks if the "logs" folder exists, if not, then creates it. -
checkFilesDirectory
public static void checkFilesDirectory()Checks that the "clients" folder exists, if not, then creates it. -
showOptions
public static void showOptions()Shows the options available for the client.
-