在Safari浏览器7(Mac OS X的10.9),Java小程序无法打开文件 [英] Java applet can't open files under Safari 7 (Mac OS X 10.9)

查看:1514
本文介绍了在Safari浏览器7(Mac OS X的10.9),Java小程序无法打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用Java程序来操作本地磁盘上文件的Web应用程序。我们开发它相当长的一段时间,我们已经知道所有类型的问题的小程序可能与现代OS'es和浏览器和最新的Java版本和新的安全限制。

We have a web app that uses Java applet to manipulate files on local disk. We develop it for quite a while and we already know all types with issues an applet may have with modern OS'es and browsers and latest Java versions and new security restrictions.

昨天苹果推出了其新的Mac OS 10.9小牛新Safari浏览器(7.0)。我测试下的Safari 7 / Mac OS X的10.9我们的Web应用程序只是为了找到野生动物园7(可能?)阻止访问本地文件从Java小程序。

Yesterday Apple rolled out its new Mac OS 10.9 Mavericks with new Safari browser (7.0). I tested our web app under Safari 7 / Mac OS X 10.9 just to find that Safari 7 (probably?) blocks access to local files from Java applet.

虽然小程序(凭有效Thawte的证书签名,并与特定于Java 7u45所有安全要求履行)的完全访问本地文件系统进行无限制模式运行(J​​ava安全提示说),对试图访问本地文件它捕获FileNotFoundException异常:

Although the applet (signed with valid Thawte certificate, and with all security requirements specific to Java 7u45 fulfilled) runs in unrestricted mode with full access to local file system (Java security prompt says that), on attempt to access the local file it catches fileNotFoundException:

java.io.FileNotFoundException: /Users/yury/Pictures/Paris 2012/L1050258.jpg (Operation not permitted)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at com.trackntag.a.v.a(Unknown Source)

另外从applet打开的Java文件打开对话框时,会显示在文件夹选择没有文件和文件夹没有任何图标(通常他们应该有他们)。当你穿越回根文件夹,可以看到顶层文件夹(斌,内核开发,家居,等等),但您无法浏览到他们。

Also when opening Java file open dialog from the applet, it displays no files and the folders in the folder selector do not have any icons (normally they should have them). When you traverse back to the root folder, you can see top level folders (bin, cores, dev, home, and so on), but you cannot browse into them.

小程序确实有本地文件的访问具有最新的Firefox 24为Mac,同机(Java 7u45的Mac OS X 10.9)上。同样的Safari 6和Mac OS X 10.8.5,更不用说各种配置Linux和Windows机器:没有问题与访问本地文件

The applet does have an access to local files with latest Firefox 24 for Mac, on the same machine (Java 7u45, Mac OS X 10.9). Same with Safari 6 and Mac OS X 10.8.5, not to mention Linux and Windows machines in various configurations: no issues with accessing local files.

拥有以上所有,我必须得出结论,我们已经遇到了特定的Safari浏览器7的问题。

Having all of above, I must conclude that we have ran into the problem specific to Safari 7.

你有任何关于此问题的想法?任何想法是极大的AP preciated。

Do you have any ideas on this issue? Any thoughts are greatly appreciated.

干杯,
尤里·

Cheers, Yury

修改(答):在Safari 7有一个新的安全设置:安全/不安全模式(我认为这是Java插件只)。您可以允许Java插件不安全的模式无论是对个别网站或所有网站的工作。在不安全模式下的小程序将不得不本地文件系统不受限制的访问。

看来,这种安全设置适用于Java的自己的安全设置(限制/不受限制的访问)之上。

It appears that this security setting works on top of Java's own security settings (restricted/unrestricted access).

此设置可通过Safari浏览器preferences /安全选项卡/互联网插件:管理网站设置,(然后选择Java插件)

This setting is available through Safari preferences / Security tab / Internet plugins: manage website settings (then select Java plugin).

所以一旦我已经回答了我自己原来的问题,我宁愿改换:是,可以设置不安全模式或覆盖特定网站/ URL安全模式,而不要求用户设置此安全preference?也许像苹果开发者证书将帮助?

So once I already answered my own original question, I would rather rephrase it: is that possible to set Unsafe mode or override Safe mode for specific web-site / URL without asking user to set this security preference? Maybe something like Apple developer certificate would help?

再次感谢!

推荐答案

今天我与另一个的Java应用程序类似的问题。我想你可能需要您的应用程序添加到列表中允许低于...的应用程序,在此对话框(系统preFS - &GT;安全与隐私权 - &GT;辅助功能

I had a similar problem with another Java app today. I think you may need to add your app to the "Allow the apps below ..." list in this dialog (System Prefs -> Security & Privacy -> Accessibility):

这篇关于在Safari浏览器7(Mac OS X的10.9),Java小程序无法打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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