Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

google chrome - Can I delete downloaded JNLP file (Java web start/JWS) from Java application?

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.

I want to add a function to our Java application:

  1. Google Chrome downloads a JNLP file and open it.
  2. The JNLP file starts our Java application.
  3. The Java application deletes the JNLP file (<= I want this function!)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...