Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.HashMap;
import java.util.Map;

public class Main {
    private static final Map<String, String> mimeTypeToExtensionMap = new HashMap<String, String>();

    /**
     * Returns true if the given MIME type has an entry in the map.
     * 
     * @param mimeType
     *            A MIME type (i.e. text/plain)
     * @return True if there is a mimeType entry in the map.
     */
    public static boolean hasMimeType(String mimeType) {
        if (mimeType == null || mimeType.isEmpty()) {
            return false;
        }
        return mimeTypeToExtensionMap.containsKey(mimeType);
    }
}