久久中文视频-久久中文网-久久中文亚洲国产-久久中文字幕久久久久-亚洲狠狠成人综合网-亚洲狠狠婷婷综合久久久久

以文本方式查看主題

-  曙海教育集團論壇  (http://www.xinguifushi.cn/bbs/index.asp)
--  JAVA語言開發  (http://www.xinguifushi.cn/bbs/list.asp?boardid=64)
----  用java語言實現的迷你型的http服務器代碼  (http://www.xinguifushi.cn/bbs/dispbbs.asp?boardid=64&id=2487)

--  作者:wangxinxin
--  發布時間:2010-12-11 10:16:36
--  用java語言實現的迷你型的http服務器代碼
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.
    

主站蜘蛛池模板: 国产禁女女网站免费看 | 日韩欧美一区二区在线 | 久草综合在线观看 | 久久久久久精 | 亚洲国产日韩欧美一区二区三区 | 在线观看精品自拍视频 | 日本综合久久 | 亚洲欧美自拍偷拍 | 久久免费播放 | 在线免费观看欧美 | 日本色网址 | 女人成午夜大片7777在线 | 特级毛片8级毛片免费观看 特级毛片免费观看视频 | 日韩精品在线一区二区 | 成年人视频在线免费播放 | 怡红院在线视频观看 | 视频精品一区 | 国产精品久久福利网站 | 国产亚洲精品影达达兔 | 2020亚洲男人天堂 | 依人九九 | 国产三级精品最新在线 | 欧美一级日本一级韩国一级 | 国产vs久久| 欧美一级欧美三级在线 | 91九色成人 | 日韩城人视频 | 精品视频一区二区三区 | 美国毛片在线 | 精品欧美一区二区三区在线观看 | 国产精品国产三级国产an不卡 | 久久欧美久久欧美精品 | 2022国产精品网站在线播放 | 久久精品青草社区 | 国产欧美日韩精品一区二 | 午夜爽爽性刺激一区二区视频 | 91精品国 | 中文字幕日韩精品亚洲七区 | 国产精品久久久久毛片 | 中文字幕一区二区视频 | 久久精品国产屋 |