java networking


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: java networking

Hybrid View

  1. #1
    tejkumar Guest

    java networking


    how can i write a program in java to achive ftp with out using any packages
    that are developed by third parties.


    can we convert a class file in source file if so how.



  2. #2
    Kandasamy Guest

    Re: java networking


    Hi,

    The code works to transfer files in ascii mode.

    ------

    import java.io.*;
    import java.net.*;
    import java.util.*;

    public class jftp {

    private String fileName;
    private File inFile;
    private File outFile;
    private String line_1;


    public jftp(String source, String dest ) {
    inFile=new File(source);
    outFile = new File(dest);
    }

    public void ftpNow(){

    BufferedReader binReader =null;



    try {
    binReader = new BufferedReader( new FileReader(inFile));
    PrintWriter pw = new PrintWriter( new BufferedWriter
    ( new FileWriter(outFile)));

    while ( (line_1=binReader.readLine()) != null ) {
    pw.println(line_1);
    }
    pw.flush();
    pw.close();
    binReader.close();
    } catch(IOException ioe) {
    System.out.println("IOException : " + ioe.getMessage());
    }
    finally{
    System.out.println("File Copied Successfully");
    }


    }

    }

    ********* End *********









    "tejkumar" <tejmail@rediffmail.com> wrote:
    >
    >how can i write a program in java to achive ftp with out using any packages
    >that are developed by third parties.
    >
    >
    >can we convert a class file in source file if so how.
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center