• 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

Urgent: Is signed applet really necessary to read local files ?

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I have an applet which accesses several local notepad.txt files. They are all on the same logical volumn and directory i.e. the html, the applet and the notepad.txt files.
The question is : do I really need a signed applet to access the text files, seeing how they are all in the same directory?
There has been contradictory answers, from "yes" to "no" to somewhere in between "You should always use a signed applet".
Although I've a self-signed certificate for testing purposes, for simplicities' sake and to save time, I'd rather not use it until I've bought a Verisign or Thawte.
So the question again: do I really need a signed applet to access local text files in the same directory as the applet and the html that launches the applet. That is to say, getCodeBase() and get DocumentBase() have same values ?
Yes, I've read the online documentation and O'Reilly's "OpenSSL" , which I thoroughly recommend.
I am doubting whether I really need a signed applet because I can easily access jpegs images, too easy. I can't see the exact reason why I should not be able to have my own applet read a local text file in the same directory as the applet.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
By default, applets have no access to system resources outside the directory from which
they were launched, but a signed applet can access local system resources as allowed
by the local system's security policy. The Java Development Kit (JDK) 1.2 provides
security tools so end users and system administrators can sign applets and applications,
and define their local security policy by specifying in a policy file how much access
to local system resources a signed applet or application can have. Well you make a sign applet it would work fine as this applet would work fine anywhere.
I hope now u can go ahead.
Thanks
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya, Jas.
Yes, I do agree with you.
I'm satisfied that an applet can access files in the same directory from which the applet and its html were launched, or, put another way, their getCodeBase() and get getDocumentBase() return same value.
In the following stub code, I've omitted getDocumentBase() and hard-coded the url. It does the job:
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic