-
Saving to png
I'm trying to save a buffered image to a png file. I've used ImageIO.write(image, "png", file). When I run it I get "java.security.AccessControlException: access denied (java.io.FilePermission map delete)" I'm trying to save to map.png which is in the same folder as my applet.
-
applet's may not write to harddisk. this is a security policy. what would happen, if any applet from the internet would have write-access to your harddisc?
make it an aplication or change your applet security policy.
-
How do u change an applet's security policy?
-
usually, you have to change the java.policy file located somewhere in the jre and jsdk folders (usually jre\lib\security).
syntax can be found at http://java.sun.com/j2se/1.3/docs/gu...licyFiles.html
some comments on applet security can be found at
http://www.javaworld.com/javaworld/j...-security.html
but you only can change the policy for your computer. if you put your applet online, other users will have their own policys (which you can't modify) and thus will not be able to read/write from filesystem.
-
easier way is to make an application from your applet.
-
Well I don't know how to make an application, nor do I have the intention. However, I did find a tutorial at http://java.sun.com/developer/techni...curity/Signed/ for applets. I tried following it, but it seems my computer can't find the command 'keytool', along with several other vital commands. Why is this?
-
keytool is located in the jdk\bin folder. perhaps you didn't configure the PATH variable properly.
-
I got keytool to work eventually. For enabling file access I made a jar file of my project, and ran "keytool -genkey" to make a key thingy. Then I ran "keytool -selfcert" to make the certificate and then -jarsigner to sign the jar file with the certificate. However, this still does not let it open the file. Why is this?
Similar Threads
-
By teja8100 in forum VB Classic
Replies: 6
Last Post: 07-08-2005, 06:03 PM
-
Replies: 1
Last Post: 05-15-2005, 09:31 AM
-
Replies: 0
Last Post: 03-10-2003, 09:29 AM
-
By Richard Dalton . in forum Architecture and Design
Replies: 14
Last Post: 12-29-2000, 12:41 AM
-
By Ralph Carrasquillo in forum VB Classic
Replies: 1
Last Post: 05-11-2000, 01:55 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|