[commons-vfs] accessing exploded WAR content at runtime

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[commons-vfs] accessing exploded WAR content at runtime

What'd be a good way to get access to a deployed WAR's content using VFS?

Right now, I'm doing:
servletContext.getRealPath("") + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + path;

And this quite inconvenient to rely on servletContext since I don't have access to it in lower layers, not speaking about the test, which in isolation don't even run in a ServletContext.

I don't see any other way than using the local file system. But if I do so, I'll get an absolute path, not a relative to the deployment folder one.

Any idea?