|
|
|
|
List of file associations?
Posted:
Oct 25, 2007 5:05 AM
|
|
|
Hi,
I've just discovered JDIC and I want to use it to obtain Windows' file associations. The API has a method (AssociationService.getFileExtensionAssociation) for getting a single file association but there seems to be no means of getting the system's entire list of file associations. Rather limiting I think. Also a pity this hasn't found its way into Java 6.
Alex
|
|
|
|
|
|
|
Re: List of file associations?
Posted:
Oct 25, 2007 6:44 AM
in response to: alexrob
|
|
|
JDIC has worked well for me in the past, but is apparently an abandoned project. Things like file extensions would be handy but maybe they're too OS-specific. The desktop-integration stuff is partially available in Java 6, but the system tray with the AWT pop-up is pretty ugly.
You could look at http://www.teamdev.com/winpack/features.jsf (based on JNIWrapper) or https://jna.dev.java.net/ as possible "active" solutions.
|
|
|
|
|
|
|
|
Re: List of file associations?
Posted:
Oct 26, 2007 5:56 AM
in response to: alexrob
|
|
|
You can find some other half-finished (never expanded to its full potential) API in the Java Activation Framework. JAF is one of the many things Sun started but doesn't pay any more attention to, so it is rotting away.
http://java.sun.com/products/javabeans/jaf/downloads/index.html
Have a look at the CommandMap and FileTypeMap interfaces for a start, but don't be disappointed that JAF only contains very limited, if not to say trivial, implementations. But since they are based on configuration files (copying the mechanisms early on used on Unix systems to handle MIME mail and support different media in browsers), you might be able to change the config to the point that it works for your application.
What JAF doesn't provide is access to what the operating system knows about file types. It could have this knowledge, only that Sun never implemented classes accessing the information.
|
|
|
|
|