Well, I download my JAR file then access it locally...
URL[] myJARs = new URL[] { new URL("file:/C:/somedir/myfiles.jar") };
URLClassLoader loader = new URLClassLoader(myJARs);
URL soundURL = loader.getResource("com/saic/sounds/sound.wav");
The resulting soundURL looks like (note the "jar" at the beginning and
the "!"):
jar:file:/C:/somedir/myfiles.jar!/com/saic/sounds/sound.wav
If the JAR file were still on your webserver, it would look like:
jar:http://yourserver.com/somedir/sounds.jar!/com/yourcompany/sound.wav
So it's always:
jar:<jar url>!<file spec within jar>
-Lee
-----Original Message-----
From: Mark Ferneau [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 12, 2000 10:03 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Cannot include sound files in JAR in J3D 1.2
Joel,
Nope. We're interested as well. Thanks for the posting. What is the
URL
that you use for the classloader, just the one you used to load the Jar
file with further specification for the file you are looking for?
For example:
- Original download JAR file: http://foo.com/myApp/allfiles.jar
- Access to a file in the jar file known as sounds/ItWorks.wav would be
http://foo.com/myApp/allfiles.jar/sounds/ItWorks.wav
Is that how it works with a JAR?
At 09:30 AM 12/12/2000 -0500, you wrote:
>Am I the only one who cares? ;) Oh well....
Mark Ferneau 240-462-6262 (cell)
Director of Adv. Technology 801-437-4608 (efax)
Xtivia Technologies, Inc. 732-469-5954 x629 (NJ office)
[EMAIL PROTECTED] 301-279-5703 (home office)
http://www.xtivia.com/ [EMAIL PROTECTED] (wireless email)
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".