Example usage for org.springframework.mail.javamail ConfigurableMimeFileTypeMap setMappings

List of usage examples for org.springframework.mail.javamail ConfigurableMimeFileTypeMap setMappings

Introduction

In this page you can find the example usage for org.springframework.mail.javamail ConfigurableMimeFileTypeMap setMappings.

Prototype

public void setMappings(String... mappings) 

Source Link

Document

Specify additional MIME type mappings as lines that follow the mime.types file format, as specified by the Java Activation Framework.

Usage

From source file:com.wavemaker.runtime.FileController.java

protected void setContentType(HttpServletResponse response, File file) {
    ConfigurableMimeFileTypeMap mimeFileTypeMap = new ConfigurableMimeFileTypeMap();
    mimeFileTypeMap.setMappings(new String[] { "text/css css CSS", "application/json json JSON smd SMD" });

    response.setContentType(mimeFileTypeMap.getContentType(file));
}