I'm struggling with this problem now
"How to store some files on filesystem in J2EE web application"
It is said, that for portability reasons accessing FS is at least not recommended.
I'd like to know what are other possibilities, to make it more portable and not performance heavy in mean time.
I can think of following ways
- use directly FS(temp files, webapp folder etc.) not really portable - maybe some user dir
- use some Virtual FS(Apache Commons VFS) - adding possibility to switch FS impl.
- store files in DB - for Lucene index files, it looses sense
- JCA - it overcomplicated and I will need adapter for every FS used
- JCR - is it good idea to use it(Apache Jackrabbit)
Where do you usually store .properties files, lucene indexes, user files, user pictures? Especially if you are using different environments for your application in your development pipeline(Openshift, Heroku, Web containers, Application servers)