已签名的应用程序| File.exists失败 [英] signed app|File.exists fails

查看:71
本文介绍了已签名的应用程序| File.exists失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我有一个已签名的小程序,我仍然无法使用File.exists访问本地文件系统。代码是愚蠢的 - 傻:

文件f =新文件(someLocalPath);

if(f.exists){...}


证书存储在Java控制台中。我还需要做什么?在问好之后,最好的方法是从applet在浏览器本地文件系统上存储个性化数据:只为用户数据建立一些路径?不能使用user.home所以它只是临时的吗?任何帮助赞赏。我真的被困了。

Hello
I have a signed applet and I still cant access the local file system with File.exists. The code is stumble-stupid:
File f = new File("someLocalPath");
if (f.exists) {...}

The cert is is stored in the Java Console. What more do I have to do? Also what is the best way, after asking nicely, to store personalized data on a browsers local file system from an applet:just establish some path for the users data? Cant use user.home so is it just ad hoc? Any help appreciated. I am really stuck.

推荐答案


你好

我有一个签名的applet和我仍然无法使用File.exists访问本地文件系统。代码是愚蠢的 - 傻:

文件f =新文件(someLocalPath);

if(f.exists){...}


证书存储在Java控制台中。我还需要做什么?在问好之后,最好的方法是从applet在浏览器本地文件系统上存储个性化数据:只为用户数据建立一些路径?不能使用user.home所以它只是临时的吗?任何帮助赞赏。我真的被卡住了。
Hello
I have a signed applet and I still cant access the local file system with File.exists. The code is stumble-stupid:
File f = new File("someLocalPath");
if (f.exists) {...}

The cert is is stored in the Java Console. What more do I have to do? Also what is the best way, after asking nicely, to store personalized data on a browsers local file system from an applet:just establish some path for the users data? Cant use user.home so is it just ad hoc? Any help appreciated. I am really stuck.



当您尝试运行代码片段时是否收到任何错误消息?

Are you getting any error messages when you try running your code snip?



尝试运行代码片段时是否收到任何错误消息?
Are you getting any error messages when you try running your code snip?



您好RedSon

谢谢除了权限被拒绝之外没有任何错误。然而从那时起,

凭经验我找到了部分答案。如果我尝试以start()以外的任何方法访问本地文件,则会失败并显示:java.security.AccessControlException:access denied(java.io.FilePermission ...

我应该有我怎么能绕过它呢?我把这个对象作为我的applet创建和调用的另一个对象的成员。任何想法?tia。

Hi RedSon
Thanks No errors other than the permission denied. However since then,
empirically I found a partial answer. If I try to access the local file in any method other than start() it fails with Caused by: java.security.AccessControlException: access denied (java.io.FilePermission...
Should I have expected that? How can I get around it? I have this object as a member of another object that my applet creates and calls. Any ideas? tia.



你好RedSon

谢谢除了许可以外没有错误。但从那以后,

凭经验我找到了部分答案。如果我试图访问本地在start()之外的任何方法中的文件都失败,引发者:java.security.AccessControlException:访问被拒绝(java.io.FilePermission ...

我应该预料到的吗?我怎么能得到我有这个对象作为我的applet创建和调用的另一个对象的成员。任何想法?tia。
Hi RedSon
Thanks No errors other than the permission denied. However since then,
empirically I found a partial answer. If I try to access the local file in any method other than start() it fails with Caused by: java.security.AccessControlException: access denied (java.io.FilePermission...
Should I have expected that? How can I get around it? I have this object as a member of another object that my applet creates and calls. Any ideas? tia.



我很惊讶你认为它是证书问题。我会认为它是我更多的文件系统问题。文件不存在或您在该目录中没有写入权限。我知道这是不好的做法,但您可以尝试使用管理权限运行您的软件,看看它是否是您的权限问题。

I''m surprised that you think it is a certificate issue. I would assume that it is more of an issue with the file system. Either the file does not exist or you do not have write permissions in that directory. I know it''s bad practice but you can try running your software with administrative rights to see if it is a problem with your permissions.


这篇关于已签名的应用程序| File.exists失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆