-
1. Re: How to access files from seam code
cptnkirk Jul 3, 2006 7:44 PM (in response to shasho)Maybe I don't understand the problem, but non-web resources can be retrieved from the file system via regular Java IO. See FileInputStream.
-
2. Re: How to access files from seam code
gavin.king Jul 3, 2006 8:54 PM (in response to shasho)Then I think you need to do a new File(....). getResourceAsStream() is only for loading stuff from the classpath.
-
3. Re: How to access files from seam code
norman.richards Jul 4, 2006 1:01 AM (in response to shasho)In addition to what's been pointed out already:
1) To solve the re-deploy problem, you can always deploy in exploded (directory) form. Then you'd always be able to add/change files freely. This only works if the files are inside of your myapp.ear/whatever.war directory, but it does solve your redeploy problem
2) If you want to really externalize this, you might also look at the ExternalContext MBean. (section 3.5.3 of the JBoss AS Guide) You can bind any just about any file system like structure (local or remote) into JNDI and access the resources that way. It's a bit heavy of a solution, but it is very flexible.