Interesting results:
When I run this test code (the names have been changed to protect the innocent):
package graphicstest;
import javax.swing.*;
import java.net.*;
import javax.imageio.*;
import java.awt.image.*;
/**
*
Title:
*
*
Description:
*
*
Copyright: Copyright (c) 2007
*
*
Company:
*
* @author not attributable
* @version 1.0
*/
public class Foo
extends JFrame {
static ImageIcon ii;
public Foo() {
setSize(200,200);
try {
System.out.println("2=aborted; 8=complete; 4=errored; 1=loading");
ii = new ImageIcon(new URL("http://intranet/part?FOO.JPG"));
System.out.println("image load status: " + ii.getImageLoadStatus());
getContentPane().add(new JLabel(ii));
System.out.println("image load status: " + ii.getImageLoadStatus());
}catch(Throwable t) {t.printStackTrace();}
}
public static void main(String args[]) {
Foo foo = new Foo();
foo.setVisible(true);
if (ii.getImageLoadStatus() == 4) {
try {
BufferedImage bi = ImageIO.read(new URL(
"http://intranet/part?FOO.JPG"));
ii.setImage(bi);
foo.validate();
foo.repaint();
} catch(Throwable t) {t.printStackTrace();};
}
}
}
. . . from a box that's not on the VPN, it blows up at the ImageIO.read() call (not unexpectedly). But if I run it from a box that's on the VPN, and able to access the URL, then it returns just fine from the ImageIO.read(), and I get a null pointer exception at the call to setImage().
Clearly, this is trying to tell me SOMETHING, but I don't quite know WHAT.
--
JHHL
B R E A K T H R O U G H !
The reason why
"http://intranet/part?FOO.JPG"
works fine in a browser, but fails to load into an ImageIcon, and makes the WinDoze "Image and Fax Viewer" lock up, is that neither it, nor the URL that appears when you feed it into a browser,
http://mogrify.foobar.com/images/scripts/cgi/detail.cgi?FOO.JPG
actually cause the server to cough up an actual JPEG image. Instead, the server coughs up a web page, which contains yet another URL:
http://mogrify.foobar.com//images/repository/sizes/live/FOO.JPG
.
The more you overthink the plumbing, the easier it is to stop up the drain!