Re: Jar: protocol question



On Sat, 29 Oct 2005 11:20:01 -0400, "Rhino"
<no.offline.contact.please@xxxxxxxxxx> wrote, quoted or indirectly
quoted someone who said :

>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.

getResource does a search and gives you a direct url to the Jar where
it found the resource.

If you want to speed that search, use the class-path and index
feature of jar.exe to build a multi-jar index for direct lookup.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.



Relevant Pages

  • 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)
  • Re: mixing RPG and Java?
    ... There is a default extension path where you can park a flock of JAR files and they will all be automatically scanned for classes -- no need to add the JAR names to the classpath. ... list of valid classpaths pointing to jars and standalone classes will get ...
    (comp.sys.ibm.as400.misc)
  • Re: Probleme mit CLASSPATH
    ... Dafür kann man in der Manifest-Datei des Jars einen Classpath ... Aber selbst wenn du ein Jar verteilst, so hast du als Administrator dir recht schnell ein Tool gebaut das evtl. ...
    (de.comp.lang.java)