Results 1 to 4 of 4
Hi all,
My original goal was to generate a password protected .xls file using Jasperreports. I was able to do the generation of said file. The problem is the "password ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-03-2012 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 7
How to password protect an existing file in linux using java
Hi all,
My original goal was to generate a password protected .xls file using Jasperreports. I was able to do the generation of said file. The problem is the "password protecting" part. I can't seem to find any tool or Api that would do the trick and that linux would accept.
So now I am hoping to find a way to password protect an existing file (any file) in linux instead (using java codes).
Thanks in advance for any suggestion that you could come up with. Please please do help. Thank you.
- 12-04-2012 #2Just Joined!
- Join Date
- Oct 2005
- Location
- Mesquite TX USA
- Posts
- 6
- 04-07-2013 #3Just Joined!
- Join Date
- Apr 2012
- Location
- Australia
- Posts
- 26
Actually (and for Java), look up the way to do it manually on the terminal in "shell command"
THEN
use System.exec() in your java code in the servlet or program.
System class in Java represents the machine and OS running , the exec is a programmatic command line for the current OS shell.
- 04-18-2013 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,152
dako has the right idea. You can't really do what you want in Linux. Encrypting the file with something like PGP is a reasonable alternative. I know that Microsoft has the ability to let you password protect any Microsoft Office file, but those are proprietary API's, and just creating an xls file won't let you do that from Linux. Not without a lot of pain and suffering to reverse-engineer their code and encrypted file structures...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote

