Java tutorial
//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"; } }