• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

File download from Unix server with password

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having some problem to get file from URL (of a unix server) with password.
I keep on getting this error: "FileNotFoundException"
However, if I enter the url in the Internet Explorer,
I am able to access the file.

My code is as follow:

...
BufferedInputStream input = null;
BufferedOutputStream output = null;

try {

String address = "ftp://username assword@myunixftpserver.domain.com/home/dir/myfile.zip";
URL url = new URL(address);
URLConnection conn = url.openConnection();

//I got the ERROR at this code below
input = new BufferedInputStream(conn.getInputStream());

...


What could be the possible problem?
Thanks in advance for your advise.

Best regards
[ September 10, 2007: Message edited by: harry flower ]
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic