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


曙海教育集團論壇開發語言培訓專區JAVA語言開發 → 用java語言實現的迷你型的http服務器代碼


  共有8830人關注過本帖樹形打印

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

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


加好友 發短信
等級:青蜂俠 帖子:1393 積分:14038 威望:0 精華:0 注冊:2010-11-12 11:08:23
用java語言實現的迷你型的http服務器代碼  發帖心情 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 ([email protected]
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單帖管理 | 引用 | 回復 回到頂部

返回版面帖子列表

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








簽名
主站蜘蛛池模板: a级毛片在线观看 | 国产日产欧产精品精品推荐在线 | 韩国毛片免费播放 | 免费特黄视频 | 伊人久热这里只有精品视频99 | 毛片网站在线播放 | 黄色一级毛片免费 | 国产综合久久久久 | 久久精品视频播放 | 精品视自拍视频在线观看 | 一级毛片aaaaaa免费看 | 亚洲区一区| 91av手机在线| 亚洲日本aⅴ片在线观看香蕉 | 九一国产 | 日韩一级黄色 | 亚洲在线观看 | 老司机亚洲精品 | 国产一级做a爰片久久毛片男 | 亚洲欧美网站 | 成人午夜精品久久不卡 | 中文字幕精品一区二区绿巨人 | 俺来也欧美亚洲a∨在线 | 亚洲精品视频免费在线观看 | 刺激一区仑乱 | 在线中文字日产幕 | 香港a毛片免费全部播放 | 亚洲精品在线免费 | 91国内精品视频 | 欧美丝袜xxxxx在线播放 | 性欧美videofree中文字幕 | 国产成人综合网在线播放 | 国产夫妇肉麻对白 | 美女视频网站色 | 欧美 亚洲 中文字幕 | 午夜影院免费入口 | 综合成人在线 | 亚洲人的天堂男人爽爽爽 | 中国一级特黄真人毛片 | 亚洲日本一区二区三区在线 | 欧美一级特黄特色大片免费 |