[英]Java Read File Permissions
I was wondering if anybody can show me way to be able to create read file permissions for my java applet. 我想知道是否有人可以告诉我能够为我的Java小程序创建读取文件权限。
The exact exception I receive is 我收到的确切例外是
java.security.AccessControlException: access denied(java.io.FilePermission filename.pdf write)
I've put f.setReadable
and f.setWriteable
where f
is the file and nothing. 我把
f.setReadable
和f.setWriteable
放在f
是文件而没有。 A little help please. 请帮助一下。
There's security limits on what an unsigned applet can do, and one of the things it can't do is access the local filesystem (see here for a full list). 对于未签名的applet可以执行的操作存在安全限制,其中一项不能访问本地文件系统的内容(请参阅此处获取完整列表)。 You have several options:
你有几个选择:
FileOpenService
and FileSaveService
to ask the user to let you read/write one particular file. FileOpenService
和FileSaveService
要求用户允许您读/写一个特定文件。 Alternatively, you can use the PersistenceService
to store a small amount of data persistently within the browser. PersistenceService
在浏览器中PersistenceService
存储少量数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.