波多在线播放_激情深爱五月_久久欧美精品_成人超碰_国产久_www.pixiv.moe

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 .03320 s, 2 queries.
主站蜘蛛池模板: 精品国产视频 | 高清视频一区 | 欧美精品一区二区三区在线 | 中国一级毛片在线视频 | 天天色天天射天天操 | 91精品国产91久久久久 | 天天噜日日噜夜夜噜 | 亚洲一区国产视频 | avbobo在线| 极品美女aⅴ高清在线观看 一级片片 | 久久成人精品 | 免费观看影院 | 成人小视频在线观看 | 午夜电影网址 | 一区二区av| 国产高清www免费视频 | 欧美综合视频 | 国产精品免费一区二区三区都可以 | 国产成人精品免高潮在线观看 | 亚洲有码转帖 | 精品天堂 | 欧美日韩大尺码免费专区 | 99精品视频一区在线视频免费观看 | 久久综合九色综合国产 | av午夜电影 | 三级国产视频 | 免费在线观看成人 | 欧美一级久久久久久久大片 | 中文字幕在线视频日本 | 国产高清一区二区 | 久爱www成人网免费视频 | 综合欧美一区二区三区 | 久久午夜电影网 | 性开放的欧美大片按摩 | 色狠狠成人综合色 | 久久久久国产 | 乳罩双性受给攻喂奶高h | 亚洲永久中文字幕在线 | 999精品免费视频 | 99热com| 添人人躁日日躁夜夜躁夜夜揉 |