com.jniwrapper.win32.shell
Class FileTypeAssociation

java.lang.Object
  extended by com.jniwrapper.win32.shell.FileTypeAssociation

public class FileTypeAssociation
extends java.lang.Object

This class provides functionality for creating file type associations.


Constructor Summary
FileTypeAssociation(java.lang.String extension)
          Creates a class instance for associating files of the specified type.
 
Method Summary
 void createAssociation(java.io.File executable, java.lang.String progID)
          Creates a file type association.
 void createAssociation(java.lang.String commandLine, java.lang.String progID)
          Creates a file type association.
 java.lang.String getDefaultCommand()
          Returns the default executable command for the file extension.
 java.lang.String getExtension()
          Returns the file extension.
 java.lang.String getProgID()
          Returns the program identifier of the default executable program.
 boolean isRegistered()
          Returns true if a file type association for the specified extension is registered.
 void removeAssociation()
          Removes all associations for the file extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTypeAssociation

public FileTypeAssociation(java.lang.String extension)
Creates a class instance for associating files of the specified type.

Parameters:
extension - specifies the file type by its extension.
Method Detail

createAssociation

public void createAssociation(java.io.File executable,
                              java.lang.String progID)
Creates a file type association.

Parameters:
executable - an associated file will be passed as a parameter of this executable file.
progID - the program identifier in the registry. If the specified program identifier does not exist, it will be created.

createAssociation

public void createAssociation(java.lang.String commandLine,
                              java.lang.String progID)
Creates a file type association.

Parameters:
commandLine - specifies an executable command.
progID - the executable program identifier in the registry. If the specified program identifier does not exist, it will be created.

removeAssociation

public void removeAssociation()
Removes all associations for the file extension.


getDefaultCommand

public java.lang.String getDefaultCommand()
Returns the default executable command for the file extension.

Returns:
the default executable command for the file extension.

getProgID

public java.lang.String getProgID()
Returns the program identifier of the default executable program.

Returns:
the program identifier of the default executable program.

isRegistered

public boolean isRegistered()
Returns true if a file type association for the specified extension is registered.

Returns:
true if a file type association for the specified extension is registered.

getExtension

public java.lang.String getExtension()
Returns the file extension.

Returns:
the file extension.