塑料排水板-植草格-土工膜厂家-泰安东诺工程材料有限公司

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 .39063 s, 2 queries.
主站蜘蛛池模板: 欧美一区二区三区不卡视频 | 免费深夜福利 | 丰满少妇女人a毛片视频 | 美女张开腿让男人捅 | 国产激情片 | 91精品国产综合久 | 一边吃奶一边添p好爽高清视频 | 无码中文人妻在线一区二区三区 | 久青草视频 | 999久久久无码国产精品 | 国产一区二区好的精华液 | 国产精品久久无码不卡黑寡妇 | 久久伊人成人网 | 久久综合久久综合九色 | 亚洲中文字幕人成影院 | 老鸭窝视频在线观看 | 精品国产黑色丝袜高跟鞋 | 亚洲日韩欧美内射姐弟 | 精品亚洲欧美中文字幕在线看 | 亚洲精品人成网在线播放影院 | 国产免费福利体检区久久 | 日日摸夜夜添夜夜添成人 | 秋霞在线视频 | 国产精品一品二区三区的使用体验 | 依人九九 | 亚洲欧美在线不卡 | www.久久色| 久久99国产这里有精品视 | 一级毛片在线看 | 国产黄a三级三级三级av在线看 | 色综久久 | 免费观看黄色网 | 亚洲aⅴ天堂av天堂无码麻豆 | 脱岳裙子从后面挺进去在线观看 | 久久国产精品亚洲一区二区 | 91新网址 | 国产精品视频人人做人人爱 | 尤物在线网站 | 亚洲国产无线乱码在线观看 | 人妻av中文字幕一区二区三区 | 美女一级毛片免费看看 |