code: private void initializeMimeExtensionArrays() throws OSException {
          // lazy initialization
          if (extensionMime == null || mimeExtension == null) {
              extensionMime = new HashMap<>();
              mimeExtension = new HashMap<>();
  
              // list all files in all directories in MIME_TYPE_FILES
              for (String dir : MIME_TYPE_FILES) {
                  File d = new File(dir);
                  if (d.exists() && d.isDirectory()) {
                      for (final File fileEntry : d.listFiles()) {
                          if (fileEntry.isFile() && fileEntry.canRead()) {
                              Set<String> tmpExtensions = new HashSet<>();
                              Set<String> tmpMimeTypes = new HashSet<>();
                              try {
                                  String content = new String(Files.readAllBytes(fileEntry.toPath()));
  
                                  Matcher extMatcher = MIME_TYPE_FILE_EXTENSION_PATTERN.matcher(content);
                                  while (extMatcher.find()) {
                                      tmpExtensions.add(extMatcher.group(1).toLowerCase());
                                  }
  
                                  Matcher mimeMatcher = MIME_TYPE_FILE_MIME_PATTERN.matcher(content);
                                  while (mimeMatcher.find()) {
                                      tmpMimeTypes.add(mimeMatcher.group(1).toLowerCase());
                                  }
                              } catch (IOException ex) {
                                  throw new OSException(ex);
                              }
  
                              // fill arrays
                              for (String ext : tmpExtensions) {
                                  if (extensionMime.containsKey(ext)) {
                                      Set<String> tmp = extensionMime.get(ext);
                                      tmp.addAll(tmpMimeTypes);
                                      extensionMime.put(ext, tmp);
                                  } else {
                                      extensionMime.put(ext, tmpMimeTypes);
                                  }
                              }
                              for (String mime : tmpMimeTypes) {
                                  if (mimeExtension.containsKey(mime)) {
                                      Set<String> tmp = mimeExtension.get(mime);
                                      tmp.addAll(tmpExtensions);
                                      mimeExtension.put(mime, tmp);
                                  } else {
                                      mimeExtension.put(mime, tmpExtensions);
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
docs: Reads all associations of MIME types with file extensions and fills the
  arrays {@link #extensionMime} and {@link #mimeExtension}.
  
  @throws OSException