Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1. public void commandMenu() {
  2.         while (true) {
  3.             System.out.println(STOR);
  4.             System.out.println(RETR);
  5.             System.out.println(LIST);
  6.             System.out.println(DISCONNECT);
  7.             System.out.print("Digite o comando : ");
  8.  
  9.             String choice;
  10.  
  11.             try {
  12.                 choice = bufferedReader.readLine();
  13.  
  14.                 switch (choice) {
  15.                     case STOR:
  16.                         commandSTOR();
  17.                         break;
  18.                     case RETR:
  19.                         commandRETR();
  20.                         break;
  21.                     case LIST:
  22.                         commandLIST();
  23.                         break;
  24.                     case DISCONNECT:
  25.                         commandDISCONNECT();
  26.                         break;
  27.                     case DELE:
  28.                         commandDELETE();
  29.                        
  30.                     default:
  31.                         System.out.println("Comando não reconhecido!");
  32.  
  33.                 }
  34.  
  35.             } catch (IOException iOException) {
  36.                 System.err.println("Opção inválida! Tente outra vez.");
  37.             }
  38.  
  39.         }
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement