Hello,
I've been reading up on security in Java Applets and whilst I understand
the concept, I can't successfully get my applet to read a file on my local
machine.
I discovered from http://java.sun.com/sfaq/#read:
-----
Sun's appletviewer allows applets to read files that are named on the access
control list for reading. The access control list for reading is null by
default, in the JDK. You can allow applets to read directories or files by
naming them in the acl.read property in your ~/.hotjava/properties file.
For example, to allow any files in the directory home/me to be read by
applets loaded into the appletviewer, add this line to your
~/.hotjava/properties file.
acl.read=/home/me
-----
(I am using Windows XP, my user name is Paul and I am trying to read
'video.properti es' in my "My Documents\Java\ " folder)
In my ~/.hotjava/properties file I have tried many combinations of:
acl.read=\My Documents\java\ video.propertie s
acl.read=C:\Doc uments and Settings\Paul\M y Documents\java\ video.propertie s
Even after saving these changes, java still complains when I try to run the
applet using appletviewer at the command line:
java.security.A ccessControlExc eption: access
denied(java.uti l.PropertyPermi ssion video.propertie s read)
I did notice however, that if I temporarily delete the .hotjava/properties
file, this made no difference and java did not complain that it couldn't be
found.
All this has confused me and left me a bit disgruntled!
How can I allow the applet to read the file?
Thank-you for your help,
Paul
I've been reading up on security in Java Applets and whilst I understand
the concept, I can't successfully get my applet to read a file on my local
machine.
I discovered from http://java.sun.com/sfaq/#read:
-----
Sun's appletviewer allows applets to read files that are named on the access
control list for reading. The access control list for reading is null by
default, in the JDK. You can allow applets to read directories or files by
naming them in the acl.read property in your ~/.hotjava/properties file.
For example, to allow any files in the directory home/me to be read by
applets loaded into the appletviewer, add this line to your
~/.hotjava/properties file.
acl.read=/home/me
-----
(I am using Windows XP, my user name is Paul and I am trying to read
'video.properti es' in my "My Documents\Java\ " folder)
In my ~/.hotjava/properties file I have tried many combinations of:
acl.read=\My Documents\java\ video.propertie s
acl.read=C:\Doc uments and Settings\Paul\M y Documents\java\ video.propertie s
Even after saving these changes, java still complains when I try to run the
applet using appletviewer at the command line:
java.security.A ccessControlExc eption: access
denied(java.uti l.PropertyPermi ssion video.propertie s read)
I did notice however, that if I temporarily delete the .hotjava/properties
file, this made no difference and java did not complain that it couldn't be
found.
All this has confused me and left me a bit disgruntled!
How can I allow the applet to read the file?
Thank-you for your help,
Paul
Comment