Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Hashtable;

public class Main {
    public static Hashtable<String, String> theMimeTypes = new Hashtable<String, String>();

    public static String getMimeType(String url) {
        String mime = null;
        int dot = url.lastIndexOf('.');
        if (dot >= 0)
            mime = (String) theMimeTypes.get(url.substring(dot + 1).toLowerCase());
        if (mime == null)
            mime = "application/octet-stream";
        return mime;
    }
}