private static Map<String, String> loadContentTypeByExtension() {
        ClassLoader classLoader = SessionContentReadResponse.class.getClassLoader();
        Pattern whitespace = Pattern.compile("\\s");
        Map<String, String> map = new HashMap<>();

        InputStream resources = Objects.requireNonNull(classLoader.getResourceAsStream("mime.types"),
                                                       "Failed to load resource 'mime.types'");
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(resources))) {
            while (reader.ready()) {
                String line = reader.readLine();
                if (line.isEmpty() || line.charAt(0) == '#') continue;

                String[] parts = whitespace.split(line);
                for (int i = 1; i < parts.length; i++)
                    map.putIfAbsent(parts[i], parts[0]);
            }

            return map;
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
Represents a response for a request to read contents of a file.

@author Ulf Lilleengen
configserver/src/main/java/com/yahoo/vespa/config/server/http/SessionContentReadResponse.java