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

查看:111
本文介绍了我可以从Java应用程序中删除下载的JNLP文件(Java Web start / JWS)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Chrome不会自动启动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. 谷歌浏览器下载一个JNLP文件并打开它。

  2. JNLP文件启动我们的Java应用程序。

  3. Java应用程序删除JNLP file(< =我想要这个函数!)

我可以获取下载的JNLP文件的文件路径,该文件启动了Java应用程序?
原因,我们的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论文描述了这种机制,因此您处于特定于供应商的领域,我不认为有一个API让您的应用程序知道JNLP文件的位置。

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.

但是,您可以为使用-wait调用原始javaws的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天全站免登陆