This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
achana chan
Ranch Hand
Posts: 277
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Jasmine kaur
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic