Sam
Sam

Reputation: 2792

Injecting a file type association in java into a Windows or Mac Environmets

How're we supposed to inject a file type association in java into a Windows or Mac environments? For instance registering .vlan file type to our java application! This would of course need to happen when the application is launching for the first time!

Thank you!

Upvotes: 1

Views: 213

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168835

  • Deploy the application using Java Web Start.
  • Declare a file type association in the JNLP file.

Part of the demo. of the FileContents API shows how to do the latter.

.. the launch file prompts the user to associate file extension .zzz (simply a file type unlikely to clash with existing file associations) of content type text/sleepytime. ..

This should work on Windows, OS X & *nix.

Upvotes: 1

Related Questions