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


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


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

主題:用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 (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單帖管理 | 引用 | 回復 回到頂部

返回版面帖子列表

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








簽名
主站蜘蛛池模板: 欧美激情一区二区三级高清视频 | 99久久99热久久精品免费看 | 欧美精品二区 | 国产99免费 | www.亚洲| 99这里只有精品6 | 久久久久亚洲精品 | 欧美日韩手机在线观看 | 99久久国产综合精品女小说 | 无码色情影片视频在线看免费 | 欧美一区二区在线免费观看 | 精品一区二区三区在线观看国产 | 暖暖日本在线播放 | www.日日操| 日韩精品第二页 | 亚洲天堂视频在线免费观看 | 久久青| 天天操欧美 | 国产特级毛片AAAAAAA高清 | 精品久久网 | 91精品福利 | 国产免费网址 | 欧美四虎| 韩国A片国产浪潮AV 久久99国产精品 | 国产视频精品视频 | 亚洲香蕉毛片久久网站老妇人 | 国产午夜精品视频 | 一级毛片一 | 性香港xxxxx免费视频播放 | 国产欧美视频在线观看 | 无码国产精品成人午夜视频 | 福利入口在线观看 | 99热热热| 亚洲综合18p | 午夜精品久久久久久久男人的天堂 | 99久久精品费精品国产一区二区 | 久久国产精品99久久小说 | 欧美日韩色综合网站 | 日本精品视频 | 三级毛片免费看 | 日本黄色大片免费观看 |