TLDR; How to open a magnet link like “magnet:?xt=blablablabl” with the default application on java
I’m working on a application that search a website for a magnet link and opens it.
Currently I’m opening firefox passing the magnet url as a parameter, but it leaves a open tab and if firefox is not installed, this method doesn’t seem to work with chrome (I didn’t tested it with ie).
What I want is to open the default application that handles the magnet protocol.
I’m aware that in windows I can get that from the registry and on ubuntu i can call xdg-open, but I’m looking for a more elegant solution on java or a library that already do this. Is there such a thing?
Lacking a better solution I wrote my own:
https://github.com/beothorn/URISchemeHandler
Also added support for registering new protocol handlers.
Still wished there was a way to handle this without checking which OS is running.
Edit:
The correct name for this identifier is URI scheme, more details at http://en.wikipedia.org/wiki/URI_scheme.