ftp client using java

hi
i am a btech student...i have to design a ftp client using java.
i dont know where to start from and what to do for a ftp client to work.please help as what libraries would i need for that and how to start.
thanks in advance!!

Comments

  • : hi
    : i am a btech student...i have to design a ftp client using java.
    : i dont know where to start from and what to do for a ftp client to
    : work.please help as what libraries would i need for that and how to
    : start.
    : thanks in advance!!
    :
    Here are a few excellent sites to help you on your way:
    - http://en.wikipedia.org/wiki/Ftp
    - http://tools.ietf.org/html/rfc959
    - http://www.google.nl/search?q=ftp+java
    This next one includes numerous links to libraries, 3rd party source codes, ftp specifications, etc:
    - http://mindprod.com/jgloss/ftp.html
  • thanks a lot for your help!!

    : : hi
    : : i am a btech student...i have to design a ftp client using java.
    : : i dont know where to start from and what to do for a ftp client to
    : : work.please help as what libraries would i need for that and how to
    : : start.
    : : thanks in advance!!
    : :
    : Here are a few excellent sites to help you on your way:
    : - http://en.wikipedia.org/wiki/Ftp
    : - http://tools.ietf.org/html/rfc959
    : - http://www.google.nl/search?q=ftp+java
    : This next one includes numerous links to libraries, 3rd party source
    : codes, ftp specifications, etc:
    : - http://mindprod.com/jgloss/ftp.html

  • : hi
    : i am a btech student...i have to design a ftp client using java.
    : i dont know where to start from and what to do for a ftp client to
    : work.please help as what libraries would i need for that and how to
    : start.
    : thanks in advance!!
    :


    Hi, I happen to be planning on doing a similar project during the summer. If you wouldn't mind would you pm me telling me how the project went and what links and libraries you found useful.

    THanks

    Matt
  • : : hi
    : : i am a btech student...i have to design a ftp client using java.
    : : i dont know where to start from and what to do for a ftp client to
    : : work.please help as what libraries would i need for that and how to
    : : start.
    : : thanks in advance!!
    : :
    :
    :
    : Hi, I happen to be planning on doing a similar project during the
    : summer. If you wouldn't mind would you pm me telling me how the
    : project went and what links and libraries you found useful.
    :
    : THanks
    :
    : Matt
    ......................................................................

    Hello ,
    I am from Virtual University , Pakistan . I am also stuck with similar file transfer problem using sockets . In my code , I have used " localhost" as the server . Now I am trying to send a text file from my computer IP 192.168.1.33 to another computer next door ( on the same LAN ) IP 192.168.1.34 . Same is not getting through , presumably the coding problem. However , simple strings like "Hello Abdul ... " , do pass on and are echoed back.

    Please tell me how you over came your problem ? Please send the code to send a text file like " stars.txt " , then recieving the confirmation of transfer. Same may be displayed on message box , or any other form.

    Please help me as I am badly stuck , despite of trying several different codes. Thanking you with sincere wishes,

    Abdul hayee ,
    ahayee84@hotmail.com
    ahayee84@yahoo.com

  • Hi there saw this thread and was thinking hmm that could be my next project.
    Anyways ran into some conversion problems when I finished. The contents of "clientfile.txt" is not identical to "serverfile.txt" it seems only the first line is diffrent. This is obviously some conversion error but I don't know where to start.

    Heres the server make a serverfile.txt file first before you run it
    [code]import java.net.ServerSocket;
    import java.net.Socket;
    import java.io.*;

    class server{
    int port;
    ServerSocket serversocket;
    Socket clientsocket;
    BufferedReader in;
    ObjectOutputStream out;

    public server(int port){
    this.port=port;

    try{
    System.out.println("creating server");
    serversocket=new ServerSocket(port);
    System.out.println("server created");
    System.out.println("awaiting connection");
    clientsocket=serversocket.accept();
    System.out.println("connection accepted");
    in=new BufferedReader(new InputStreamReader(clientsocket.getInputStream()));
    out=new ObjectOutputStream(clientsocket.getOutputStream());
    }
    catch(java.io.IOException e){
    System.out.println(e);
    System.out.println("couldnt create server on port:"+port);
    }

    try{
    SendByte(ReadFile("serverfile.txt"));
    }
    catch(IOException e){
    System.out.println(e);
    System.out.println("error couldnt find or send file");
    }
    }
    public void SendByte(byte[] bytearray)throws java.io.IOException{
    out.writeObject(bytearray);
    }
    public String GetString()throws java.io.IOException{
    return in.readLine();
    }
    public byte[] ReadFile(String filename) throws IOException { //Only for smaller files?
    InputStream in = new FileInputStream(filename);
    byte[] data = new byte[in.available()];
    in.read(data);
    return data;
    }
    public static void main(String arg[]){
    new server(1001);
    }
    }[/code]
    Heres the client
    [code]import java.net.Socket;
    import java.io.*;

    class client{
    String ip;
    int port;
    Socket socket;
    ObjectInputStream in;
    PrintWriter out;

    public client(String ip,int port){
    this.ip=ip;
    this.port=port;
    try{
    Connect();
    CreateFile(GetObject());
    }
    catch(java.net.UnknownHostException e){
    System.out.println(e);
    System.out.println("error couldnt find host");
    }
    catch(java.io.IOException e){
    System.out.println(e);
    System.out.println("error couldnt establish connection");
    }
    catch(java.lang.ClassNotFoundException e){
    System.out.println(e);
    System.out.println("I dont really know");
    }
    }
    public void Connect()throws java.net.UnknownHostException,IOException{
    socket=new Socket(ip,port);
    in=new ObjectInputStream(socket.getInputStream());
    out=new PrintWriter(socket.getOutputStream(),true);
    }
    public void CreateFile(Object o1)throws IOException{
    FileOutputStream fos = new FileOutputStream("clientfile.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(o1);
    oos.close();
    }
    public void SendString(String message){
    out.println(message);
    }
    public byte[] GetByte()throws java.io.IOException,java.lang.ClassNotFoundException{
    return (byte[])in.readObject();
    }
    public Object GetObject()throws IOException,java.lang.ClassNotFoundException{
    return in.readObject();
    }
    public static void main(String arg[]){
    String ip="localhost";
    int port=1001;
    new client(ip,port);
    }
    }[/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories