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 voidcheckClientArgs(String[] arguments) Checks the arguments introduced by the user.static voidChecks that the "clients" folder exists, if not, then creates it.static voidChecks if the "logs" folder exists, if not, then creates it.static voidExecPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Executes a petition in the server.static voidExitPetition(String petition, OutputStream out, Socket clientSocket) Sends the "EXIT" petition to the server.static voidListPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Lists the files in the server directory requested by the client.static voidMain method of the client.static voidReceivePetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Receives a file from the server.static voidRuns a "normal" client.static voidrunPetitions(Socket clientSocket) Runs the petitions of the client.static voidRuns the "SSL" client mode.static voidSendPetition(String petition, OutputStream out, InputStream in, String[] petitionTokens) Sends a petition to the server.static voidShows the options available for the client.static voidStarts the client bifurcating between the "normal" and "ssl" modes.static voidInitializes 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.
-