Java Mime Type Get getMimeType(String file)

Here you can find the source of getMimeType(String file)

Description

get Mime Type

License

Open Source License

Declaration

public static String getMimeType(String file) 

Method Source Code

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

import java.net.FileNameMap;
import java.net.URLConnection;

public class Main {

    public static String getMimeType(String file) {
        FileNameMap fileNameMap = URLConnection.getFileNameMap();
        String type = fileNameMap.getContentTypeFor(file);
        return type;
    }//w w  w  .j  a  v a  2s  .  c  o  m
}

Related

  1. extractMimeType(byte[] imageData)
  2. getExactMimeType(String fileName)
  3. getMimeType(File file)
  4. getMimeType(String fileName)
  5. getMIMEType(String fileName)
  6. getMimeType(String fileName)
  7. getMimeType(String fileName)