[commons-vfs] accessing exploded WAR content at runtime

1 message Options
Embed this post
Permalink
nodje

[commons-vfs] accessing exploded WAR content at runtime

Reply Threaded More More options
Print post
Permalink
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?