• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Password Protect a File or Directory

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic