Maybe there is a better way to solve my problem.
I need some way to upload, download and list files in my server in a folder of my choosing in the file system.
I tried doing this using org.apache.catalina.servlets.DefaultServlet but the problem is that I cant control the webapp base folder (Context docBase is not supported in virgo).
I can write my own servlet but it seems bad practice to rewrite what I already have implemented in DefaultServlet.
What do you suggest doing ?
You could copy the DefaultServlet code and provide some other way of configuring a directory, e.g. by using config admin (for which see the OSGi compendium spec) and supplying the configuration by deploying a properties file.
In order to install web applications as bundles we have to perform several transformations. Because of this:
- We do not want to make such transformations in the "source".
- There may have file system access permissions that may prevent the transformations.