views:

24

answers:

1

I have to access a config file which is in a directory on the app server file system, but is not deployed as part of my J2EE app.

Would getResourceAsStream() help me in this case?

Thanks

+1  A: 

Would getResourceAsStream() help me in this case?

Not unless the config file is on the classpath, no. You're going to have use java.io to do what you need, unless you can convince the appserver to fetch it for you by some non-standard means.

This will take you outside of the JavaEE realm, and runs the risk of falling afoul of the appserver's security model.

skaffman
Are you saying that using java.io is a security risk according to the appserver model?
Kapsh
@Kapsh: Not a risk, as such, but the appserver may be configured to forbid it.
skaffman