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 .03125 s, 2 queries.
主站蜘蛛池模板: 国产AV成人一区二区三区| 亚洲国产成人精品无码区在线观看 | 黄网在线观看视频| 亚洲av无一区二区三区| 国产福利免费视频| 日韩欧美卡一卡二卡新区| 麻豆md国产在线观看| 久久精品中文騷妇女内射| 国产在线观看免费不卡| 日本边添边摸边做边爱喷水| 黄色aaa级片| 久久91精品久久91综合| 午夜不卡av免费| 国内xxxx乱子另类| 极度虐乳扎钉子bdsm| 蜜中蜜3在线观看视频| 一级毛片在线免费播放| 亚洲色图视频在线观看| 国产精品无码无需播放器| 欧洲精品免费一区二区三区| 超碰97人人做人人爱少妇| 一二三高清区线路1| 亚洲图片欧美日韩| 国产性夜夜春夜夜爽| 成人国产一区二区三区| 永久看一二三四线| 麻豆aⅴ精品无码一区二区| 一个人看的视频在线| 亚洲另类欧美综合久久图片区| 国产亚洲自拍一区| 夜夜爽一区二区三区精品| 欧美va天堂视频在线| 练瑜伽的时候进入| 在线看的你懂的| 一级做α爱过程免费视频 | 四虎在线免费播放| 国产麻豆精品精东影业av网站| 日韩午夜电影在线观看| 秋霞电影网一区二区三区| 国产一区二区三区夜色| av天堂永久资源网|