Java Path File Mime Type nio getMimeType(String absolutePath)

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

Description

get Mime Type

License

Open Source License

Declaration

public static String getMimeType(String absolutePath) throws IOException 

Method Source Code

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

import java.io.IOException;

import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
    public static String getMimeType(String absolutePath) throws IOException {
        Path path = Paths.get(absolutePath);
        return java.nio.file.Files.probeContentType(path);
    }/*from  w  w w. j  a  v  a2 s  .c o m*/
}

Related

  1. getMimeType(Path path)