我可以从 Java 应用程序中删除下载的 JNLP 文件(Java web start/JWS)吗?
谷歌浏览器不会自动启动 JNLP 文件,所以我建议我们的用户 这个解决方案.它可以工作,但下载的 JNLP 文件仍保留在下载文件夹中.手动删除它们很麻烦.
Google Chrome does not launch JNLP file automatically, so I recommend for our users this solution. It works but the downloaded JNLP file remains in download folder. Deleting them manually is troublesome.
我想向我们的 Java 应用程序添加一个函数:
I want to add a function to our Java application:
- Google Chrome 会下载 JNLP 文件并将其打开.
- JNLP 文件启动我们的 Java 应用程序.
- Java 应用程序删除 JNLP 文件(<= 我想要这个函数!)
我可以获取已下载的启动 Java 应用程序的 JNLP 文件的文件路径吗?当然,我们的 Java 应用程序 jar 已签名并且可以访问本地资源.
Can I get the file path of the downloaded JNLP file which started the Java application? Of cause, our Java application jar is signed and can access local resources.
Java WebStart 论文中没有任何内容描述这种机制,因此您处于特定于供应商"的领域,我认为没有一个让您的应用程序知道 JNLP 文件在哪里的 API.
There is nothing in the Java WebStart paper that describes such a mechanism, hence you are in "vendor-specific" territory, and I do not think that there is an API letting your application know where the JNLP file is.
但是,您可以替换 javaws,后者使用 -wait 调用原始 javaws,然后删除 JNLP 文件.这必须由用户安装.
You can, however, provide a replacement for javaws which invoke the original javaws with -wait and delete the JNLP file afterwards. This must be installed by the user.