Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change Security Permissions Temporarily

 
Prem Khan
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating an app that creates a pdf file from jasper reports.

On a link action, i will create the pdf file in a directory and redirect to the file name that was just created.

I dont want anyone to be able to see the contencts of the report directory, only the person who is currently launching the report. Is there any way to do this.

Or is this a bad way of thinking about it ?
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shawn DeSarkar:
I am creating an app that creates a pdf file from jasper reports.

On a link action, i will create the pdf file in a directory and redirect to the file name that was just created.

I dont want anyone to be able to see the contencts of the report directory, only the person who is currently launching the report. Is there any way to do this.

Or is this a bad way of thinking about it ?


This sounds like the wrong way to do what you want. I can't see who you would give the temporary permission to. I think you should create the file in a directory that is under WEB-INF (or some other directory owned by your web server, if you are deployed from a war file) and then use a servlet to send the file contents to the user by writing into the ServletOutputStream as described in this Javaworld tip., or just send it without ever creating the file.

[ June 25, 2005: Message edited by: peter wooster ]
[ June 25, 2005: Message edited by: peter wooster ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic