This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Password Protect a File or Directory  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to make an application where in from a servlet a file is to be created and stored on local pc, which contains some important info..

Now What I want is that When I create a file it should be password protected so that when anybody tries to open it directly (i.e. by double clicking on the file) it would not be accessible without password..

Is it Possible??

If not, can I have such directory..
so as to implement "vault" like mechanism.
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ketul Parikh wrote:Hi All,

I need to make an application where in from a servlet a file is to be created and stored on local pc, which contains some important info..


Any ideas how you were going to do that with a Servlet? Servlets run on the server, they can't interact with the file system on the client.


Now What I want is that When I create a file it should be password protected so that when anybody tries to open it directly (i.e. by double clicking on the file) it would not be accessible without password..


Why would you allow download of a file the client (potentially) cannot open?
 
Author and ninkuma
Marshal
Posts: 66804
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best thing to do would to not allow download except for people that should see the file in the first place. Failing that, perhaps a password-protected PDF might work?

In any case, not really a Servlets question.
 
Ketul Parikh
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to create that file on Server only, I want that no user of Server can access it without password..

No client side interaction or downloading is going to be done.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bear mentioned a password protected PDF would probably work for you.

You can also password protect zip files.
Unfortunately, Java (last I checked) can't create password protected zip files so you would need to look for a third party library to do this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66804
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ketul Parikh wrote:No client side interaction or downloading is going to be done.


Then what did you mean by:

Ketul Parikh wrote:... a file is to be created and stored on local pc


?

Local PC == client
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!