private void resolveFileTypeDetector() {
        // collect all first to avoid concurrency issues #8797
        List<FileTypeDetector> detectors = ServiceLoader.load(FileTypeDetector.class, applicationClassLoader).stream()
                .map(ServiceLoader.Provider::get)
                .collect(Collectors.toList());

        fileTypeDetector = new FileTypeDetector() {

            @Override
            public String probeContentType(Path path) throws IOException {
                for (FileTypeDetector detector : detectors) {
                    String result = detector.probeContentType(path);
                    if (result != null) {
                        return result;
                    }
                }

                // fallback to default
                return Files.probeContentType(path);
            }
        };
    }
A {@link PrimeApplicationContext} is a contextual store for the current application.

It can be accessed via:
<blockquote>
PrimeApplicationContext.getCurrentInstance(context)
</blockquote>
primefaces/src/main/java/org/primefaces/context/PrimeApplicationContext.java