In download mode, server reads data from the socket and writes it to standard output. @throws Exception
()
| 58 | * @throws Exception |
| 59 | */ |
| 60 | @SuppressWarnings("Duplicates") |
| 61 | private static boolean download() throws Exception { |
| 62 | DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream()); |
| 63 | outToClient.writeBytes(new Scanner(System.in).useDelimiter("\\Z").next()); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | private static String getcmd(Scanner sc) throws Exception { |
| 68 | String cmd = sc.nextLine(); |