Java Activation Mimetype Check setMinetypes()

Here you can find the source of setMinetypes()

Description

set Minetypes

License

Open Source License

Declaration

public static void setMinetypes() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.activation.MimetypesFileTypeMap;

public class Main {
    private static final MimetypesFileTypeMap mimeTypeMap = new MimetypesFileTypeMap();

    public static void setMinetypes() {
        mimeTypeMap.addMimeTypes("text/plain txt");
        mimeTypeMap.addMimeTypes("text/html html htm xhtml");
        mimeTypeMap.addMimeTypes("text/javascript js");
        mimeTypeMap.addMimeTypes("text/css css");

        mimeTypeMap.addMimeTypes("image/png png");
        mimeTypeMap.addMimeTypes("image/jpeg jpeg");
        mimeTypeMap.addMimeTypes("image/jpeg jpg");
        mimeTypeMap.addMimeTypes("image/gif gif");
        mimeTypeMap.addMimeTypes("image/x-icon ico");

        mimeTypeMap.addMimeTypes("application/xml xml");
        mimeTypeMap.addMimeTypes("application/json json");
        mimeTypeMap.addMimeTypes("application/pdf pdf");
    }//from www.j a v a  2s. c  o  m
}

Related

  1. initFileTypeMap()
  2. isFileImage(String fileName)
  3. isImage(String fileName, boolean output)
  4. isMimeType(String a)
  5. isValidateContentType(String contentType)