Results 1 to 2 of 2
Thread: FTP by web links
- 07-12-2010, 04:30 AM #1
Member
- Join Date
- Apr 2010
- Posts
- 19
- Rep Power
- 0
FTP by web links
hi all,
here are my codes, Im encountering some problems which will also be listed below can anynoe shed some light to this error that i cannot solve?
the error im getting is this:Java Code:import java.io.*; import java.net.URL; import java.net.URLConnection; import java.io.FileOutputStream; public class ftp { public static void main(String[] args) { try{ URL url = new URL("ftp://ftp.wwpdb.org//pub//pdb//data//structures//all//pdb//;type=i"); URLConnection con = url.openConnection(); BufferedInputStream in = new BufferedInputStream(con.getInputStream()); FileOutputStream out = new FileOutputStream("D://project1//MP Project//FTP Downloads//"); int i = 0; byte[] bytesIn = new byte[1024]; while ((i = in.read(bytesIn)) >= 0) { out.write(bytesIn, 0, i); } out.close(); in.close(); } catch(Exception e) { e.printStackTrace(); } } }
java.io.FileNotFoundException: D:\project1\MP Project\FTP Downloads (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:179)
at java.io.FileOutputStream.<init>(FileOutputStream.j ava:70)
at ftp.main(ftp.java:15)
Process completed.
- 07-12-2010, 04:23 PM #2
Similar Threads
-
Skipping links!!!
By jvh in forum New To JavaReplies: 2Last Post: 03-04-2010, 12:11 AM -
browser and links
By toker in forum New To JavaReplies: 2Last Post: 02-21-2010, 01:27 AM -
Finding web links
By ishdevil in forum New To JavaReplies: 2Last Post: 02-11-2010, 11:42 AM -
links between variables
By Keerti in forum New To JavaReplies: 2Last Post: 08-12-2008, 03:07 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks