[4806] in java-interest
URL help...
daemon@ATHENA.MIT.EDU (Paul Benati)
Mon Jan 15 18:49:25 1996
Date: Mon, 15 Jan 1996 17:42:04 -0500
To: java-interest@java.sun.com
From: Paul Benati <benatip@pcd.kodak.com>
Hi,
I'm trying to open a connection to a server in order to receive data--an
image. As you will probably notice from the code below, I don't fully
understand the way Java URL code is supposed to be written. Can someone
out there please lend me a hand? Thanks in advance!
Paul
Below is the snippet of code I'm using...
try
{
myURL = new URL("http", "webdev.kodak.com", "/cgi-bin/pcd/boy.pcd");
URLConnection urlConnection = myURL.openConnection();
currentImage = (Image) myURL.getContent();
}
catch(IOException e)
{
System.out.print("Unable to get image from: ");
System.out.println(myURL.toString());
System.out.println(e.getMessage());
}
catch(MalformedURLException e)
{
System.out.println("URL not found or incorrect: [" + e.toString() + "]");
System.out.println("getMessage = [" + e.getMessage() + "]");
}
Paul Benati
Digital Imaging Evangelist
Software Engineer/Imaging Scientist
Eastman Kodak Company benatip@kodak.com
http://www.kodak.com/ ftp.kodak.com
901 Elmgrove Road (716) 253 - 1775 (EP Office)
Rochester, NY 14653-5555 (716) 726 - 7295 (EP Fax)
233 - 1775 (KMX/Internal)
"I know that you believe you understand what you think I said, but
I am not sure you realize that what you heard is not what I meant."
-- by unknown author.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com