Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URL constructor Question

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to use this constructor..
public URL(String protocol,
String host,
int port,
String file) throws MalformedURLExceptio
to get an image (temp.jpg) on a remote machine. GetImage can take a URL object.
I use "file" for protocol, the correct IP and port, then what do I put for file? It is at c:/windows/temp/temp.jpg
I tried that and also tried c:\\windows\\temp\\temp.jpg
But both throw an excpetion when I try to open a connection. Any ideas? Thanks.
 
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file:// protocol allows you to take files from local machine, using the path as an absolute path within OS. So, it can't contain port and hostname.

------------------
With best of best regards, Pawel S. Veselov ( aka Black Angel )
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!