Applet and policy file questions

N

Neil Cherry

I'm writing an applet (Java 1.4.2) that needs to read one file and
write to another file on the user's PC. I've created a test applet and
I've run it through appletviewer and it works fine. When I run it
through Firebird (I'm using the javaplugin) I get an exception when I
attempt to write to the file (same applet that worked with
appletviewer).

I have a .java.policy in my $HOME directory and in
~/.java/deployment/security/java.policy and
~/.java/deployment/security/.java.policy (same file copied to 3
different places). I have a file called foo and bar in my home
directory and everyone has read and write permissions. Lastly this is
my policy file:

grant codeBase "file:." {
permission java.io.FilePermission "foo", "read, write";
permission java.io.FilePermission "bar", "write";
};

Any pointers? Also where would the file go if it were on a MAC or
Windows 2K or XP machine?
 
A

Andrew Thompson

| I'm writing an applet (Java 1.4.2) that needs to read one file
and
| write to another file on the user's PC.
.....
| I have a .java.policy in my $HOME directory and in

I thought the 'policy' files were very
old hat and had been replaced by WebStart,
but Sun has made documents that mention
the policy file quite recently.

But that was just a round-about way to get
to my question. Had you considered
delivering your app. through Webstart?

Get that right and it should solve all security
problems (well, ..for the developer anyway)
 
N

Neil Cherry

| I'm writing an applet (Java 1.4.2) that needs to read one file
| and write to another file on the user's PC.
....
| I have a .java.policy in my $HOME directory and in

I thought the 'policy' files were very
old hat and had been replaced by WebStart,
but Sun has made documents that mention
the policy file quite recently.

But that was just a round-about way to get
to my question. Had you considered
delivering your app. through Webstart?

Hmm, didn't know about that, I'll go look up web start. I have it on
one of my Windows boxes. I'll see if I can find it for Linux too.
 
A

Andrew Thompson

| On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:

| ..I'll go look up web start.

It should come standard with the latest
Java. (So I'd be very surprised if it did
not come with both Linux and Apple
variants)
 
N

Neil Cherry

| On Sun, 18 Jan 2004 21:49:29 GMT, Andrew Thompson wrote:

| ..I'll go look up web start.

It should come standard with the latest
Java. (So I'd be very surprised if it did
not come with both Linux and Apple
variants)

According to Sun it's in the 1.4.2 JRE (I have j2sdk1.4.2_02 which
should contain it). So far I know nothing about it but I just found
the API and I'm looking around. Turns out I also upgrade 1 Win2K PC so
I have it set up for Mozilla on 2 machines. On my other Windows
machine I'll setup IE (ick!) to use Web Start. I'll probalby still
have to figure out the policy issue since a few users may not be on
Web Start.
 
N

Neil Cherry

According to Sun it's in the 1.4.2 JRE (I have j2sdk1.4.2_02 which
should contain it). So far I know nothing about it but I just found

I've done a bunch of poking around and JNLP (javaws) works half as
good as the demo's I'll be on very happy camper. The files are tiny,
which is real good because I need to rewrite a DOS Application and
store it on the XPort (www.lantronics.com) which only gives me 64K
of space to store the applet (JNLP?). Thanks for the info.
 
N

Neil Cherry

I've done a bunch of poking around and JNLP (javaws) works half as
good as the demo's I'll be on very happy camper. The files are tiny,
which is real good because I need to rewrite a DOS Application and
store it on the XPort (www.lantronics.com) which only gives me 64K
of space to store the applet (JNLP?). Thanks for the info.

Ignore the size comment, I was looking at the .jnlp file and not the
..jar file. Still very cool!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top