Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * @brief      get mimitype from one content type string
     * 
     * @param      contentType   [IN]  content type value in html file
     * 
     * @return     Return mimi type value
     */
    public static String getMimiType(String contentType) {
        if (contentType != null) {
            int semicolonIndex = contentType.indexOf(';');
            if (semicolonIndex != -1) {
                return contentType.substring(0, semicolonIndex);
            }
        }
        return "text/html";
    }
}