Search in sources :

Example 1 with MimeUtil2

use of eu.medsea.mimeutil.MimeUtil2 in project gerrit by GerritCodeReview.

the class MimeUtil2Module method provideMimeUtil2.

@Provides
@Singleton
MimeUtil2 provideMimeUtil2() {
    MimeUtil2 m = new MimeUtil2();
    m.registerMimeDetector(ExtensionMimeDetector.class.getName());
    m.registerMimeDetector(MagicMimeMimeDetector.class.getName());
    if (HostPlatform.isWin32()) {
        m.registerMimeDetector("eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector");
    }
    m.registerMimeDetector(DefaultFileExtensionRegistry.class.getName());
    return m;
}
Also used : ExtensionMimeDetector(eu.medsea.mimeutil.detector.ExtensionMimeDetector) MagicMimeMimeDetector(eu.medsea.mimeutil.detector.MagicMimeMimeDetector) MimeUtil2(eu.medsea.mimeutil.MimeUtil2) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 MimeUtil2 (eu.medsea.mimeutil.MimeUtil2)1 ExtensionMimeDetector (eu.medsea.mimeutil.detector.ExtensionMimeDetector)1 MagicMimeMimeDetector (eu.medsea.mimeutil.detector.MagicMimeMimeDetector)1