Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void commandDELETE() {
- try {
- dataConnectionOutputStream.writeUTF(DELE);
- String filename;
- System.out.println("Entre com o nome do arquivo a ser deletado : ");
- filename = bufferedReader.readLine();
- dataConnectionOutputStream.writeUTF(filename);
- String reply = dataConnectionInputStream.readUTF();
- if (reply.equals(FILE_NOT_FOUND)) {
- System.out.println("Arquivo não encontrado no servidor.");
- } else if (reply.equals(FILE_STATUS_OK)) {
- System.out.println("Tem certeza que quer deletar o arquivo? ");
- String option;
- option = bufferedReader.readLine();
- if (option.equals(NO)) {
- //dataConnectionOutputStream.flush();
- return;
- }
- if (option.equals(YES)){
- dataConnectionOutputStream.writeUTF(YES);
- }
- }
- System.out.println("Arquivo deletado com sucesso! ");
- }
- catch (IOException ex) {
- System.err.println("Não foi possível deletar o arquivo.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement