日韩国产欧美精品一区二区三区,亚洲男女自偷自拍图片另类,亚洲欧美久久久,亚洲国产成人一区

以文本方式查看主題

-  曙海教育集團(tuán)論壇  (http://www.qqmingzi123.com/bbs/index.asp)
--  JAVA語(yǔ)言開(kāi)發(fā)  (http://www.qqmingzi123.com/bbs/list.asp?boardid=64)
----  用java語(yǔ)言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼  (http://www.qqmingzi123.com/bbs/dispbbs.asp?boardid=64&id=2487)

--  作者:wangxinxin
--  發(fā)布時(shí)間:2010-12-11 10:16:36
--  用java語(yǔ)言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼
package  positron.harness;

import  java.io.BufferedReader;
import  java.io.ByteArrayInputStream;
import  java.io.File;
import  java.io.FileInputStream;
import  java.io.IOException;
import  java.io.InputStream;
import  java.io.InputStreamReader;
import  java.io.OutputStream;
import  java.io.PrintWriter;
import  java.io.UnsupportedEncodingException;
import  java.net.ServerSocket;
import  java.net.Socket;
import  java.net.URLEncoder;
import  java.util.Date;
import  java.util.Enumeration;
import  java.util.HashMap;
import  java.util.Locale;
import  java.util.Map;
import  java.util.Properties;
import  java.util.StringTokenizer;
import  java.util.TimeZone;

/**
 * A simple, tiny, nicely embeddable HTTP 1.0 server in Java
 *
 * This class has been trivially modified from its original form, taken from
 * 
http://elonen.iki.fi/code/nanohttpd/NanoHTTPD.java
 *
 * <p> NanoHTTPD version 1.1,
 * Copyright &copy; 2001,2005-2007 Jarno Elonen (elonen@iki.fi, 
http://iki.fi/elonen/ )
 *
 * <p><b>Features + limitations: </b><ul>
 *
 *    <li> Only one Java file </li>
 *    <li> Java 1.1 compatible </li>
 *    <li> Released as open source, Modified BSD licence </li>
 *    <li> No fixed config files, logging, authorization etc. (Implement yourself if you need them.) </li>
 *    <li> Supports parameter parsing of GET and POST methods </li>
 *    <li> Supports both dynamic content and file serving </li>
 *    <li> Never caches anything </li>
 *    <li> Doesn\'t limit bandwidth, request time or simultaneous connections </li>
 *    <li> Default code serves files and shows all HTTP parameters and headers</li>
 *    <li> File server supports directory listing, index.html and index.htm </li>
 *    <li> File server does the 301 redirection trick for directories without \'/\'</li>
 *    <li> File server supports simple skipping for files (continue download) </li>
 *    <li> File server uses current directory as a web root </li>
 *    <li> File server serves also very long files without memory overhead </li>
 *    <li> Contains a built-in list of most common mime types </li>
 *    <li> All header names are converted lowercase so they don\'t vary between browsers/clients </li>
 *
 * </ul>
 *
 * <p><b>Ways to use: </b><ul>
 *
 *    <li> Run as a standalone app, serves files from current directory and shows requests</li>
 *    <li> Subclass serve() and embed to your own program </li>
 *    <li> Call serveFile() from serve() with your own base directory </li>
 *
 * </ul>
 *
 * See the end of the source file for distribution license
 * (Modified BSD licence)
 
*/
public   class  NanoHTTPD
{
    
//  ==================================================
    
//  API parts
    
//  ==================================================

    
/**
     * Override this to customize the server.<p>
     *
     * (By default, this delegates to serveFile() and allows directory listing.)
     *
     * @parm uri    Percent-decoded URI without parameters, for example "/index.cgi"
     * @parm method    "GET", "POST" etc.
    

主站蜘蛛池模板: 叶城县| 合山市| 溧水县| 道真| 普宁市| 永顺县| 鄄城县| 莱阳市| 永康市| 石阡县| 崇明县| 松桃| 海城市| 璧山县| 灵川县| 揭阳市| 长岛县| 新昌县| 涞源县| 五家渠市| 城固县| 松潘县| 新津县| 奉贤区| 长沙市| 永登县| 社旗县| 嘉峪关市| 镇康县| 玉田县| 晋中市| 安义县| 吉林省| 吉安市| 遂昌县| 武宁县| 神池县| 石棉县| 陆川县| 翼城县| 新化县|