Question

I am using jboss AS7 as server and also i am using the following code for getting all jar files which contains particular resource file.


 try {
       urls = Thread.currentThread().getContextClassLoader().getResources("config.properties");
//Here gets all jar files url which contains config.properties file
            } catch (IOException e) {
                throw new AWGenericException(e);
            }

But in the case of JBOSS the all urls are appeared in the form of VFS (virtual file system) format. So the url strings are looks like follows


vfs:/E:/Servers/JBOSS/standalone/deployments/isms.war/WEB-INF/lib/ariba.aribaweb.jar/META-INF/config.properties

actually i dont need the vfs url i need the url which appears in regular format which looks like follows.


jar:file:/E:/Servers/JBOSS/standalone/deployments/isms.war/WEB-INF/lib/ariba.aribaweb.jar!/META-INF/config.properties

Is it possible to turn off this feature (vfs) in JBOSS AS7

Was it helpful?

Solution

No it is not possible since JBoss AS7 uses VFS for its storage system.

You can however, go getPath() on your URL Object which will just return your path like:

E:/Servers/JBOSS/standalone/deployments/isms.war/WEB-INF/lib/ariba.aribaweb.jar/META-INF/config.properties

Which you could in theory add jar:file: to the start and replace the .jar within the getPath() with .jar! if you need it to match.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top