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.
Printable View
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.
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.
>
>