code: @Override
      public boolean registerFileExtension(String fileTypeName, String fileTypeExtension, String application) throws RegistryException, OSException {
          if (!isApplicable()) {
              return false;
          }
  
          // sanitize file extension
          fileTypeExtension = sanitizeFileExtension(fileTypeExtension);
  
          // create path to linked application
          String applicationPath = toWindowsPath(new File(application).getAbsolutePath());
  
          // Set registry hive
          WindowsRegistry.Hive hive = WindowsRegistry.Hive.HKEY_CURRENT_USER;
  
          // create programmatic identifier
          WindowsRegistry.createKey(hive.getName() + SOFTWARE_CLASSES_PATH + fileTypeName);
  
          // create verb to open file type
          WindowsRegistry.createKey(hive.getName() + SOFTWARE_CLASSES_PATH + fileTypeName + SHELL_OPEN_COMMAND_PATH);
          WindowsRegistry.writeValue(hive.getName() + SOFTWARE_CLASSES_PATH + fileTypeName + SHELL_OPEN_COMMAND_PATH, WindowsRegistry.DEFAULT_KEY_NAME, "\"" + applicationPath + "\" \"%1\"");
  
          // associate with file extension
          WindowsRegistry.createKey(hive.getName() + SOFTWARE_CLASSES_PATH + fileTypeExtension);
          WindowsRegistry.writeValue(hive.getName() + SOFTWARE_CLASSES_PATH + fileTypeExtension, WindowsRegistry.DEFAULT_KEY_NAME, fileTypeName);
          return true;
      }
docs: Registers a new file extension in the Windows registry.
  
  @param fileTypeName Name of the file extension. Must be atomic, e.g.
  <code>foocorp.fooapp.v1</code>.
  @param fileTypeExtension File extension with leading dot, e.g.
  <code>.bar</code>.
  @param application Path to the application, which should open the new
  file extension.
  @return <code>true</code> if registration was successful,
  <code>false</code> otherwise.
  @throws RegistryException If keys can't be created or values can't be
  written.