在线中文-在线在线ccc66-在线永久免费观看的毛片-在线永久免费观看的a站视频-久久精品最新免费国产成人-久久精品综合一区二区三区


曙海教育集團(tuán)論壇開發(fā)語言培訓(xùn)專區(qū)JAVA語言開發(fā) → 用java語言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼


  共有9074人關(guān)注過本帖樹形打印

主題:用java語言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼

美女呀,離線,留言給我吧!
wangxinxin
  1樓 個性首頁 | 博客 | 信息 | 搜索 | 郵箱 | 主頁 | UC


加好友 發(fā)短信
等級:青蜂俠 帖子:1393 積分:14038 威望:0 精華:0 注冊:2010-11-12 11:08:23
用java語言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼  發(fā)帖心情 Post By: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.
    

支持(0中立(0反對(0單帖管理 | 引用 | 回復(fù) 回到頂部

返回版面帖子列表

用java語言實(shí)現(xiàn)的迷你型的http服務(wù)器代碼








簽名
主站蜘蛛池模板: 中文国产成人精品少久久 | 五月天色婷婷综合 | 在线免费日本 | 黄色一级片免费网站 | 一区二区三区不卡在线 | 久久久久亚洲视频 | 亚洲日韩欧美一区二区在线 | 欧美成人伊人十综合色 | 欧美第一页在线 | 伊人无码高清 | 国产高清一级在线观看 | 宅男的天堂| 欧美国产亚洲一区 | 久久精品视频亚洲 | 欧美日韩在线成人 | 色综合成人丁香 | 两性免费视频 | 国产小视频免费 | 国产成人综合久久精品亚洲 | 久久一区二区精品综合 | 久久国产精品久久精品国产 | 18pao国产成视频永久免费 | 亚洲欧美中文日韩二区一区 | 国产精品成人一区二区不卡 | 羞羞视频在线免费 | 精品视频一区二区 | 亚洲黄色小视频 | 亚洲精品男人天堂 | 综合色影院 | 四虎精品成人免费影视 | 欧美成人精品一区二三区在线观看 | 欧美成人黑人xx视频免费观看 | 久久国产一级毛片一区二区 | 亚洲男人在线天堂 | 国产色在线播放 | 九月婷婷开心九月 | 5月色婷婷 | 波多野结衣免费视频观看 | 综合色网站 | 免费高清a级毛片在线播放 美女隐私羞羞视频在线观看 | 成人精品国产 |