Access file system from applet

R

René Iversen

Hi,

I'm trying to create at applet, that has to access the filesystem.

I've found out, for it to work I needed to add these 3 lines to the
java.policy file:
permission java.util.PropertyPermission "user.dir", "read";
permission java.lang.RuntimePermission "modifyThread";
permission java.io.FilePermission "C:\\read\\-", "read";

However it seemes like the syntax of line 3 isn't correct. What I want is to
grant read access to everything in the read folder recusively. As it is now,
I can't even browse to the read folder using a JFileChooser.

Can anyone help.
 
A

Andrew Thompson

I'm trying to create at applet, ...

Given the mention of adjusting policy files for extra permissions,
I am compelled to ask who this applet is for.

Applets only really make sense with a large, distributed user base,
whereas adjusting policy files is well suited to ..testing.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
R

René Iversen

Andrew Thompson said:
Given the mention of adjusting policy files for extra permissions,
I am compelled to ask who this applet is for.

Applets only really make sense with a large, distributed user base,
whereas adjusting policy files is well suited to ..testing.

And I am currently testing...
 
A

Andrew Thompson

And I am currently testing...

You might have added a few details to that..

What do you intend to do at deployment?

Java Webstart? If so it will need to be signed. Do
you have a certificate from a certified 'root' or do
you, or have you, rolled your own security cetificate?

Why not use AppletVeiwer until ready for deployment?
<http://java.sun.com/sfaq/#summary>

Did you notice this mentions '*', not '-'..
<http://java.sun.com/docs/books/tutorial/figures/security1.2/WTaddFilePerm.gif>

I am no expert on the 'permissions file', simply because
I have never found any reason to mess with it. There is
*always* a better way to go, including developing your
applet as an *application* until just before deployment.

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
R

René Iversen

Andrew Thompson said:
What do you intend to do at deployment?

I haven't decided yet, for different reasons. As far as I know it costs more
than I'm willing to pay to sign an applet, and the applet will be used on a
temporary web-page for only a limited number of users, so editing the
permission file will probably not be a problem.
Java Webstart? If so it will need to be signed. Do
you have a certificate from a certified 'root' or do
you, or have you, rolled your own security cetificate?

The answer is no, but maybe you can tell me, if it can be done for 0$ or
just very cheap... and I will probably need a howto.
Why not use AppletVeiwer until ready for deployment?
<http://java.sun.com/sfaq/#summary>

Did you notice this mentions '*', not '-'..
<http://java.sun.com/docs/books/tutorial/figures/security1.2/WTaddFilePerm.gif>

this does:
http://java.sun.com/j2se/1.5.0/docs/api/java/io/FilePermission.html
I am no expert on the 'permissions file', simply because
I have never found any reason to mess with it. There is
*always* a better way to go, including developing your
applet as an *application* until just before deployment.

I appreciate your help very much!
 
A

Andrew Thompson

I haven't decided yet, for different reasons. As far as I know it costs more
than I'm willing to pay to sign an applet, ...
..if it can be done for 0$

* It can.

I use a 'self-signed certificate' for the PhySci software
suite. The installer presents a warning that is similar to this..
<http://www.physci.org/install/security.jsp>

If the user accepts the certificate, it is an effortless install for them.
... and I will probably need a howto.

I have no specific materials put together to take you
through it step by step, but Sun's materials in the tutorial
guide you through it step by step.

And the answer is??

O...K Did you *try* that? Your original string had
permission java.io.FilePermission "C:\\read\\-", "read";
Whereas I suggest..
permission java.io.FilePermission "C:\\read\\*", "read";

(Sheeeesh..) Take the pointers and hints, this conversation
is like walking through molasses.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
R

René Iversen

Andrew Thompson said:
I use a 'self-signed certificate' for the PhySci software
suite. The installer presents a warning that is similar to this..
<http://www.physci.org/install/security.jsp>

If the user accepts the certificate, it is an effortless install for them.

That's nice, but how do I get/create er selv-signed certificate?
And the answer is??

I don't think this has anything to do with my problem.
O...K Did you *try* that? Your original string had

Yes, of course!
Whereas I suggest..
permission java.io.FilePermission "C:\\read\\*", "read";

(Sheeeesh..) Take the pointers and hints, this conversation
is like walking through molasses.

Sorry, I'm not as good as you. It must be nice.
 

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

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top