Annotated Bibliography On Import Java

719 Words3 Pages
import java.io.*; import java.util.*; import java.net.*;

public class FTPClient {

public Socket sock = null; public BufferedReader read; public BufferedWriter write; public ServerSocket ss; public int byteTransfered; public Scanner input = new Scanner(System.in);

// Check client connect to server public boolean connected = false; public boolean exit = false; String response = null;

// run the main code here public static void main(String args[]) { FTPClient c= new FTPClient();

while (!c.exit) { try { if (c.connected) { System.out.print("myftp> "); } else { System.out.print("Enter Server Name: "); } String text; text = c.input.nextLine();

if(text.equals("quit")) { c.quit(); return; } else if(text.equals("ls")) { c.ls(); } else { String splitString[] = text.split(" ", 2); String fString = splitString[0]; String sString = splitString[1];

if (fString.equals("myftp")) { c.login(sString); } else if (fString.equals("get")) { c.get(sString); } else if (fString.equals("put")) { c.put(sString); } else if (fString.equals("delete")) { c.delete(sString); } } } catch (Exception e) { System.out.println("Please use only put, get, ls, delete, and quit. "); } } } // send commands to the server private String

More about Annotated Bibliography On Import Java

Open Document