class MimeTypeDetectors {

    public static MimeTypeDetector createDetectorFor(String mimeTypeDetectionConfig, Environment environment) {
        switch (mimeTypeDetectionConfig.toLowerCase()) {
            case RepositoryConfiguration.FieldValue.MIMETYPE_DETECTION_CONTENT: {
                return TIKA_AVAILABLE ? new TikaContentDetector(environment) : new DefaultMimeTypeDetector();
            }
            case RepositoryConfiguration.FieldValue.MIMETYPE_DETECTION_NAME: {
                return TIKA_AVAILABLE ? new TikaNameOnlyDetector(environment) : new DefaultMimeTypeDetector();
            }
            case RepositoryConfiguration.FieldValue.MIMETYPE_DETECTION_NONE: {
                return NullMimeTypeDetector.INSTANCE;
            }
            default: {
                throw new IllegalArgumentException("Unknown mime-type detector setting: " + mimeTypeDetectionConfig);
            }
        }   
    }

    private  MimeTypeDetectors();

}