Jar: protocol question



I've been using the Jar: protocol a bit in the last few days and I'd like to
know if this is a valid use of that protocol:

jar:file:!/Images/foo.gif

Basically, I'm trying to describe the location of a GIF that a program
should be able to find in one of the various jars that are on the classpath
used by the program.

Since 'this.getClass().getResource()' will search EVERY jar in the classpath
for the desired file, it shouldn't be necessary to specify the jar name.
Therefore, it seems to me that this should be valid notation for indicating
that the jar name isn't necessary in this case: the bang ('!') in the name
following the 'file:' suggests to me that the default jar(s), namely all of
the jars found in the classpath, will be searched for an Images directory
and a file named foo.gif within that directory.

Does that seem reasonable? If not, can anyone suggest a better notation to
use for my situation?

I can't find any discussion of this "special case" in the articles I've seen
about the Jar: protocol.


--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare


.



Relevant Pages

  • Re: protocol question
    ... >> I've been using the Jar: protocol a bit in the last few days and I'd ... within a jar on the filesystem. ...
    (comp.lang.java.programmer)
  • Re: protocol question
    ... > to know if this is a valid use of that protocol: ... i.e. the URL of the jar file. ... More on protocol handlers can be found at ...
    (comp.lang.java.programmer)
  • Re: how to set up a simple plugin mechanism
    ... > relevant classes or a list of names from which the relevant class ... > classpath or in some jar. ... WhatEverPlugin interface, and if they do I load them. ...
    (comp.lang.java.help)
  • Re: Suchreihenfolge =?ISO-8859-15?Q?f=FCr?= CLASS-Files
    ... Umgebungsvariable CLASSPATH eine aus einem JAR bestehende Anwendung ... Zielrechner eine alte Version meiner Bibliotheken installiert habe und im ... einer fremden Maschine alles installiert hat (meist nur die JVM mit ...
    (de.comp.lang.java)
  • Re: Java on VMS
    ... Maybe you just need to put a missing jar file in WEB-INF/lib. ... I have had some issues with getting jars to show on the classpath, ... I'm no VMS pro so I'm not entirely sure ...
    (comp.os.vms)