code: @Override
      public String getFileExtension(String fileTypeExtension) throws RegistryException, OSException {
          if (!isApplicable() || !isFileExtensionRegistered(fileTypeExtension)) {
              return null;
          }
  
          // sanitize file extension
          fileTypeExtension = sanitizeFileExtension(fileTypeExtension);
  
          Hive[] hives = {Hive.HKEY_CURRENT_USER, Hive.HKEY_LOCAL_MACHINE};
  
          // get fileTypeName
          String fileTypeName = null;
          for (Hive h : hives) {
              if (WindowsRegistry.existsKey(h.getName() + SOFTWARE_CLASSES_PATH + fileTypeExtension)) {
                  fileTypeName = WindowsRegistry.readValue(h.getName() + SOFTWARE_CLASSES_PATH + fileTypeExtension, WindowsRegistry.DEFAULT_KEY_NAME);
              }
          }
  
          // get file association
          if (fileTypeName != null) {
              for (Hive h : hives) {
                  if (WindowsRegistry.existsKey(h.getName() + SOFTWARE_CLASSES_PATH + fileTypeName + SHELL_OPEN_COMMAND_PATH)) {
                      String fileTypeAssociation = WindowsRegistry.readValue(h.getName() + SOFTWARE_CLASSES_PATH + fileTypeName + SHELL_OPEN_COMMAND_PATH, WindowsRegistry.DEFAULT_KEY_NAME);
                      Matcher m = PATTERN_TEXT_BETWEEN_QUOTES.matcher(fileTypeAssociation);
  
                      // If exists return first string between quotes
                      while (m.find()) {
                          return m.group(1);
                      }
  
                      // otherwise return complete file association string
                      return fileTypeAssociation;
                  }
              }
          }
          return null;
      }
docs: Returns the associated application for a given extension.
  
  @param fileTypeExtension File extension with leading dot, e.g.
  <code>.bar</code>.
  @return {@link String} with path to associated application or
  <code>null</code> if file extension is not registered or can't be read.
  @throws RegistryException If Registry can't be read.