diff options
author | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2007-04-03 23:50:29 +0000 |
---|---|---|
committer | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2007-04-03 23:50:29 +0000 |
commit | 674d8ceefc57439b5dbd6d374ddae66252b05019 (patch) | |
tree | 7d44dcc64548562219981aa1ce8faed1b79a8cb6 /src | |
parent | d6ea91348d2580bbcaf616014f0a64980d953978 (diff) |
Allow user to specify a URL on the command line
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java b/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java index 6800d67..cedf1d5 100644 --- a/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java +++ b/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java @@ -155,7 +155,15 @@ public class TextureImage extends Applet { java.net.URL url = null; if (args.length > 0) { try { - url = new java.net.URL("file:" + args[0]); + final String name = args[0]; + if (name.startsWith("http:") || + name.startsWith("https:") || + name.startsWith("ftp:") || + name.startsWith("file:")) { + url = new java.net.URL(name); + } else { + url = new java.net.URL("file:" + name); + } } catch (java.net.MalformedURLException ex) { System.out.println(ex.getMessage()); System.exit(1); |