wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes How to read file as a different user from java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to read file as a different user from java application" Watch "How to read file as a different user from java application" New topic
Author

How to read file as a different user from java application

varun srivastv
Greenhorn

Joined: Oct 15, 2009
Posts: 16
Hi,

I am running a java web application as unix user USER1. The application connects to a database whose DB username and password is stored in a file(say xyz) which is readable only for unix user USER2 and not USER1. How can I read the username and password from the file whic is accessible only to USER2 while running my application as USER1.

Thanks,
Varun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read file as a different user from java application