code: public Map<String, Set<String>> getMimeApps() throws OSException {
          // lazy initialization
          if (mimeApps == null) {
              mimeApps = new HashMap<>();
  
              for (String path : MIME_APPS_LISTS) {
                  File mimeAppListFile = new File(path);
                  if (mimeAppListFile.exists() && mimeAppListFile.isFile() && mimeAppListFile.canRead()) {
                      try (BufferedReader br = new BufferedReader(new FileReader(mimeAppListFile))) {
                          for (String line; (line = br.readLine()) != null;) {
                              String mimeType = null;
                              Set<String> apps = new HashSet<>();
                              Matcher extMatcher = MIME_TYPE_APPS_PATTERN.matcher(line);
                              while (extMatcher.find()) {
                                  if (extMatcher.group(1) != null) {
                                      mimeType = extMatcher.group(1);
                                  }
                                  if (extMatcher.group(2) != null) {
                                      apps.add(extMatcher.group(2));
                                  }
                              }
  
                              if (mimeType != null && apps.size() > 0) {
                                  mimeApps.put(mimeType, apps);
                              }
                          }
                      } catch (IOException e) {
                          throw new OSException(e);
                      }
                  }
              }
          }
          return Collections.unmodifiableMap(mimeApps);
      }
docs: Creates a map of MIME types pointing on the associated application.
  
  @return Key-value-pairs of MIME types and the associated application.
  @throws OSException