Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting the files from other server

 
saravanan balu
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i need to retrieve files from the web server from my app server n these two servers are in two different machines over the network.can anyone tell me how to do that??
thanks...
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there are several approaches but the simplest might be to use a URL object. Something like
java.net.URL url = new URL( "file://webserver.com/file/myFile" );
InputStream in = URL.openStream();
etc,...
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic