我可以从 Java 应用程序中删除下载的 JNLP 文件(Java web start/JWS)吗? [英] Can I delete downloaded JNLP file (Java web start/JWS) from Java application?

查看:23
本文介绍了我可以从 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:

  1. Google Chrome 会下载 JNLP 文件并将其打开.
  2. JNLP 文件启动我们的 Java 应用程序.
  3. 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.

这篇关于我可以从 Java 应用程序中删除下载的 JNLP 文件(Java web start/JWS)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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