Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing to a file

 
Barry Myer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my applet to write to a file. I'm not part of a network. I am getting the following error when I run it in applerviewer:

Error: access denied (java.io.FilePermission topScores.txt write)

How do I get permission to write? Give that this is my own PC that is not part of a network, wouldn't I automatically have permissions? Will I also need permission to read? If so, how do I get that?
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find all the info you need on this topic at Sun Java Security FAQ. Good luck!
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exception u got is due to:

1.No one is allowed to write any stuff from internet to users machine.If u write by any other means with out user's accetance it is illeagal.
So the browser throws this exception.

To overcome this:

U have to get a Digital Certificate from a third party like VeriSign and attach the certificate to your .class file with Netscape's signtool command or SUN's jarsigner command.

Then all will work fine.

There are lots of exaples in the ent for this.I suggest u go to the SUN's site.They have even given an example for this.

You also try google with KW:"File reading and Writting from browser".

I hope this is useful.
 
Barry Myer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to you both.

I checked out the java site you suggested. It states that I should import a file called Duke into my identity database. Already, I am stumped. What is an identity database? and where is mine likely to be? I have jre 1.1.6 if that's helpful
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Barry -

I found this security article on Sun's web site. Might be helpful. Good luck!
 
Barry Myer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff:

Both sources that you gave me ask me to type in things like:

% javakey -cs "duke" true

Where do I type it in? I do have a folder for jdk1.2.1/bin and it includes applications named jarsigner and keytool but you can't type anything in them.
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They look to me like command-line entries. In Windows, start a DOS session and type them in. In Linux, well, that depends on the flavor, but the principle is the same...
 
Barry Myer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again but unfortunately I am still missing something. When I type that command, % javakey -cs Duke true all I get is the standard "Bad command or file name" I did download the plugin and the duke signature file and placed it in my User Home Directory (C:\Windows). Does anyone know what else I should do? I still don't know what a identity database is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic