-
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.
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks