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

Rss & SiteMap

曙海教育集團論壇 http://www.bjzhda.cn

曙海教育集團論壇
共1 條記錄, 每頁顯示 10 條, 頁簽: [1]
[瀏覽完整版]

標題:用java語言實現的迷你型的http服務器代碼

1樓
wangxinxin 發表于:2010-12-11 10:16:36
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.
    
共1 條記錄, 每頁顯示 10 條, 頁簽: [1]

Copyright © 2000 - 2009 曙海教育集團
Powered By 曙海教育集團 Version 2.2
Processed in .06201 s, 2 queries.
主站蜘蛛池模板: 亚洲综合日本 | 日韩美女网站 | 亚洲一区天堂 | 国产高颜值露脸在线观看 | 精品国产97在线观看 | 久久免费高清视频 | 欧美久久视频 | 九九久久免费视频 | 午夜成人影视 | 国产高清在线精品 | 欧美成人在线免费观看 | 精品一区二区三区在线成人 | 一级床上爽高清播放 | 大片刺激免费播放视频 | 美国全免费特一级毛片 | 久爱午夜精品免费视频 | 日韩毛片欧美一级a网站 | 看全色黄大色黄大片毛片 | 99久久久久国产 | 成人9久久国产精品品 | 韩国毛片 | 亚洲午夜在线 | 97视频在线视频 | 成人18视频在线 | 久久久久女人精品毛片九一 | 国产欧美日韩综合精品无毒 | 三级网站国产 | 模特精品一区二区三区 | 狠狠色综合网站久久久久久久 | 国产精品久久久久一区二区 | 九九欧美 | 全部免费的毛片在线看美国 | 性色网址| 国产一级毛片外aaaa | 国产成人精品系列在线观看 | 国产成人综合亚洲 | 免看一级a一片成人123 | 国自产精品手机在线视频香蕉 | 中文字幕99在线精品视频免费看 | 欧美视频在线一区二区三区 | 成 人免费va视频 |