The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » JDIC

Thread: List of file associations?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Oct 26, 2007 5:56 AM by: twe Threads: [ Previous | Next ]
alexrob

Posts: 1
List of file associations?
Posted: Oct 25, 2007 5:05 AM
 
  Click to reply to this thread Reply

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

chris_e_brown

Posts: 72
Re: List of file associations?
Posted: Oct 25, 2007 6:44 AM   in response to: alexrob
 
  Click to reply to this thread Reply

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.

twe

Posts: 6
Re: List of file associations?
Posted: Oct 26, 2007 5:56 AM   in response to: alexrob
 
  Click to reply to this thread Reply

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.




 XML java.net RSS