dev@glassfish.java.net

Re: Way to access files in META-INF of ejb modules

From: Craig McClanahan <Craig.McClanahan_at_Sun.COM>
Date: Mon, 22 Jan 2007 12:14:33 -0800

Marek Potociar wrote:
> Hello,
>
> is there an API in GF that would allow us to access files located in
> META-INF directory of deployed ejb module jar?
I've used the standard JarFile and JarEntry APIs to do this sort of
thing. Something like the following should work::

    URL url = ...; // URL of the JAR file you want to examine
    JarFile jarFile = ((JarURLConnection)
url.openConnection()).getJarFile();
    JarEntry jarEntry = jarFile.getJarEntry("META-INF/faces-config.xml");
    if (jarEntry != null) {
        ... process the data in this config file ...
    } else {
        ... config file not present in this JAR ...
    }

Craig

>
> Marek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>