Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (inputValues[0].equalsIgnoreCase("RETR")) {
- if(!inputValues[0].equalsIgnoreCase("LIST") && inputValues.length == 1 ) {
- if(inputValues[0].equalsIgnoreCase("RETR") && inputValues.length == 1 )
- output.writeUTF("");
- continue; }
- output.writeUTF(rIMSG);// to server
- // output.flush();//clears the line
- if(getInput.readUTF().equalsIgnoreCase("true")) {//listen from server
- try {
- ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
- byte[] buffer = (byte[]) ois.readObject();
- System.out.println("#"+buffer.length);
- String sent = k.nextLine();
- if(sent.equalsIgnoreCase("send")) {
- FileOutputStream fos = new FileOutputStream(inputValues[1]);
- fos.write(buffer);
- fos.flush();
- System.out.print("This is a small file, the file is sent without a terminating null.");
- }
- else {
- System.out.print("+ok, RETR aborted");
- rIMSG="";
- }
- } catch (ClassNotFoundException xd) {
- }
- }
- else {
- System.out.println("-File not found.");
- check = 1;
- }
- continue;
- }
- if (!inputValues[0].equals("RETR"))
- output.writeUTF(rIMSG);
- } catch (IOException e) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement