getting path to application associated with file type

Hello,

I'm looking for a platform-independent way to get path to application associated with given file type. Desktop API introduced in JSE 1.6 seems to do this, but it only lanuches the app.

Any suggestions will be apprecieted

[247 byte] By [Useful_Idiota] at [2007-11-27 11:24:18]
# 1

There isn't a platform-independent way of doing that, because not all platforms associate a filetype with an application. On Unix-like OS's there's no concept of file extensions whatsoever

georgemca at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...
# 2

Okay then, how can I open the file in it's associated application AND get the Process object of app's instance?

Useful_Idiota at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...
# 3

What app?

georgemca at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...
# 4

One in which the file was opened - I need to call "waitFor()".

Useful_Idiota at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...
# 5

I can't help you because you ignored my advice and simply re-worded your original question

georgemca at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...
# 6

> Okay then, how can I open the file in it's associated

> application AND get the Process object of app's

> instance?

If it doesn't bother you that the app will only work on windoze, then you can use the shell "start" command on the file.

Process proc = Runtime.getRuntime().exec(new String[]{"cmd", "/C","start",filePath});

However waitFor() will only wait for the process to be launched, not completed. Since your program doesn't know what Windoze will choose to launch, this makes sense.

malcolmmca at 2007-7-29 15:57:28 > top of Java-index,Java Essentials,Java Programming...