WinAssociations (install4j API)
Description: declaration: package: com.install4j.api.windows, class: WinAssociations

# Class WinAssociations

java.lang.Object
com.install4j.api.windows.WinAssociations

public class WinAssociations extends Object
Collection of static methods to create and remove file associations on Microsoft Windows.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `create(String extension, String description, File iconFile, File executable)`
  Creates a file association.
  `static boolean`
  `exists(String extension)`
  Checks whether a file association already exists.
  `static String`
  `getExecutable(String extension)`
  Retrieves the executable associated with an extension.
  `static void`
  `remove(String extension)`
  Removes a file association.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### create

    public static void create(String extension, String description, File iconFile, File executable)
    Creates a file association.
    Parameters:
      `extension` - the extension including the leading dot (e.g. ".doc").
      `description` - a description of the file type.
      `iconFile` - the icon file for the document. Can be null.
      `executable` - the executable that shall be called with the file as a parameter.

  - ### exists

    public static boolean exists(String extension)
    Checks whether a file association already exists.
    Parameters:
      `extension` - the extension including the leading dot (e.g. ".doc").
    Returns:
      true if an association exists

  - ### getExecutable

    public static String getExecutable(String extension)
    Retrieves the executable associated with an extension.
    Parameters:
      `extension` - the extension including the leading dot (e.g. ".doc").
    Returns:
      the executable associated with the given extension. Null if there is no association.

  - ### remove

    public static void remove(String extension)
    Removes a file association.
    Parameters:
      `extension` - the extension including the leading dot (e.g. ".doc").