Class RCC


public class RCC extends Object
RCC (Remote Cloud Client) is a client that connects to a server to send, receive, list and execute files.
  • Constructor Details

    • RCC

      public RCC()
  • Method Details

    • main

      public static void main(String[] args)
      Main method of the client.
      Parameters:
      args - Arguments introduced by the user.
    • checkClientArgs

      public static void checkClientArgs(String[] arguments)
      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

      public static void runPetitions(Socket clientSocket)
      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

      public static void ExitPetition(String petition, OutputStream out, Socket clientSocket)
      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.