Hey Erik,

[EMAIL PROTECTED] wrote:
>     >> I (Erik O.) wrote:
>     >> ... and perhaps all packages downstream.
>     >> This would support the use of multiple schema files, multiple packages with 
>Descriptors.
>     >> However, then you have to deal with looking for Descriptors in two places:
>     >> -- loose .class files on the file system: use java.io.File to enumerate all 
>files in a package.
>     >> -- in jar files: perhaps use java.util.zip.ZipFile to enumerate all files in 
>a package.

Yes, but the code is not too bad however and the method to choose can be
determined easily by the code I provide below...

> 
> One more thing.  How would we know which jar(s) to look in to find particular 
>package?
> 'Suppose you could (gulp) look thru all jars in the cp.

It's not that difficult, Java can do it automatically. 

If we're given "com.acme" as a package name, simply replace all '.' with
'/' and use the Class#getResouce method:

URL url = getClass().getResource("com/acme");

If the path is a jar file it will look like:

jar:file:/C:/jars/acme.jar!/com/acme/

So you can tell it's in a jar file and which one it's in.

If the path is in the local filesystem it'll look like:

file:/C:/unjarred/com/acme/

If we're given "com.acme.*" as the package name, simply remove the '*'
and repeat the above process.

Ahh shoot, I might as well just go and write the code and check it in.
:-)

--Keith

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to