0

Possible Duplicate:
How to open a file with the default associated program

As in the title, how to determine the application that will be used by the OS to open a file? For example I'd like to retrieve the application name and it's path for random pdf file... Is there an internal Java method independant of the OS (working for most of them)?

Thx...

Community
  • 1
  • 1
bioMind
  • 171
  • 1
  • 2
  • 9
  • It's unclear what you are asking. How are applications associated with files? – djechlin Jan 15 '13 at 19:23
  • Association file type with application works on the OS level. How to get the application from within Java aplication that will be used by the OS to open that file. For PDF the Acrobat Reader will be used if installed. Can I get this peace of info using pure Java? – bioMind Jan 15 '13 at 19:29
  • yes, see [here](http://stackoverflow.com/questions/6273221/open-a-text-file-in-the-default-text-editor-via-java) – linski Jan 15 '13 at 21:34

1 Answers1

0

Probably not. For Windows, you need to deal with the registry. Writing to the Windows registry in Java is discussed in read/write to Windows Registry using Java.

Community
  • 1
  • 1
monex0
  • 238
  • 1
  • 8
  • I was hoping there is something I can use for both Windows and UNIX ... :) – bioMind Jan 15 '13 at 19:38
  • Well here is some information about file association in Ubuntu (Nautilus file manager): [where are file associations stored?](http://askubuntu.com/questions/16580/where-are-file-associations-stored) – monex0 Jan 15 '13 at 19:41