亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? serve.java

?? 用java開發的
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
    sun.misc.BASE64Decoder base64Dec = new sun.misc.BASE64Decoder();    // for sessions	int uniqer;    HttpSessionContextImpl sessions;		static int expiredIn;	protected Hashtable arguments;	     /// Constructor.    public Serve( Hashtable arguments, PrintStream logStream )    {        this.arguments = arguments;        this.logStream = logStream;        registry = new PathTreeDictionary();	    realms = new PathTreeDictionary();        attributes = new Hashtable();		sessions =  new HttpSessionContextImpl();		setAccessLogged();		expiredIn = arguments.get(ARG_SESSION_TIMEOUT) != null?					((Integer)arguments.get(ARG_SESSION_TIMEOUT)).intValue():DEF_SESSION_TIMEOUT;		port = arguments.get(ARG_PORT) != null?					((Integer)arguments.get(ARG_PORT)).intValue():DEF_PORT;    }        public Serve()    {        this( new Hashtable(), System.err );    }        	void setAccessLogged() {		String logflags = (String)arguments.get(ARG_LOG_OPTIONS);		if (logflags != null) {			useAccLog = true;			showUserAgent = logflags.indexOf('A') >= 0;			showReferer = logflags.indexOf('R') >= 0;		}	}		boolean isAccessLogged() {		return useAccLog;	}	boolean isShowReferer() {		return showReferer;	}	boolean isShowUserAgent() {		return showUserAgent;	}	    /// Register a Servlet by class name.  Registration consists of a URL    // pattern, which can contain wildcards, and the class name of the Servlet    // to launch when a matching URL comes in.  Patterns are checked for    // matches in the order they were added, and only the first match is run.    public void addServlet( String urlPat, String className )    {        addServlet( urlPat, className, (Hashtable)null );    }        public void addServlet( String urlPat, String className,  Hashtable initParams)    {                // Check if we're allowed to make one of these.        SecurityManager security = System.getSecurityManager();        if ( security != null )        {            int i = className.lastIndexOf( '.' );            if ( i != -1 )            {                security.checkPackageAccess(                    className.substring( 0, i ) );                security.checkPackageDefinition(                    className.substring( 0, i ) );            }        }                // Make a new one.        try        {            addServlet( urlPat, (Servlet) Class.forName( className ).newInstance(), initParams );            return;        }        catch ( ClassNotFoundException e )        {            log( "Class not found: " + className );        }        catch ( ClassCastException e )        {            log( "Class cast problem: " + e.getMessage() );        }        catch ( InstantiationException e )        {            log( "Instantiation problem: " + e.getMessage() );        }        catch ( IllegalAccessException e )        {            log( "Illegal class access: " + e.getMessage() );        }        catch ( Exception e )        {            log( "Unexpected problem creating servlet: " + e, e );        }    }        /// Register a Servlet.  Registration consists of a URL pattern,    // which can contain wildcards, and the Servlet to    // launch when a matching URL comes in.  Patterns are checked for    // matches in the order they were added, and only the first match is run.    public void addServlet( String urlPat, Servlet servlet )    {        addServlet( urlPat, servlet, (Hashtable)null);    }    public void addServlet( String urlPat, Servlet servlet, Hashtable initParams )    {        try        {            servlet.init( new ServeConfig( (ServletContext) this, initParams, urlPat ) );            registry.put( urlPat, servlet );        }        catch ( ServletException e )        {            log( "Problem initializing servlet: " + e );        }    }        /// Register a standard set of Servlets.  These will return    // files or directory listings, and run CGI programs, much like a    // standard HTTP server.    // <P>    // Because of the pattern checking order, this should be called    // <B>after</B> you've added any custom Servlets.    // <P>    // The current set of default servlet mappings:    // <UL>    // <LI> If enabled, *.cgi goes to CgiServlet, and gets run as a CGI program.    // <LI> * goes to FileServlet, and gets served up as a file or directory.    // </UL>    // @param cgi whether to run CGI programs	// TODO: provide user specified CGI directory	public void addDefaultServlets( String cgi ) { 		if ( cgi != null )			addServlet( "/"+cgi, new Acme.Serve.CgiServlet() );		addServlet( "/", new Acme.Serve.FileServlet() );	}        /// Register a standard set of Servlets, with throttles.    // @param cgi whether to run CGI programs    // @param throttles filename to read FileServlet throttle settings from	public void addDefaultServlets( String cgi, String throttles ) throws IOException { 		if ( cgi != null )			addServlet( "/"+cgi, new Acme.Serve.CgiServlet() );		addServlet( "/", new Acme.Serve.FileServlet( throttles ) );	}	        // Run the server.  Returns only on errors.    boolean running = true;    public void serve()    {        final ServerSocket serverSocket;        try        {            serverSocket = createServerSocket();         }        catch ( IOException e )        {            log( "Server socket: " + e );            return;        }		hostName = serverSocket.getInetAddress().getHostName();        new Thread(new Runnable() {            public void run() {                BufferedReader in = new BufferedReader(new InputStreamReader(System.in));                String line;                while (true) {                    try {                        System.out.print("Press \"q\" <ENTER>, for gracefully stopping the server ");                        line = in.readLine();                        if (line != null && line.length() > 0 && line.charAt(0) == 'q') {                            running = false;							serverSocket.close();                            break;                        }                    } catch(IOException e) {                    }                }				            }        }, "Stop Monitor").start();		if (expiredIn > 0) {			Thread t = new Thread(new Runnable() {				public void run() {					while ( running ) {						try {							Thread.sleep(expiredIn*60*1000);						} catch(InterruptedException ie) {						}						Enumeration e = sessions.keys();						while(e.hasMoreElements()) {							Object sid = e.nextElement();							if (sid != null) {								AcmeSession as = (AcmeSession)sessions.get(sid);								if (as != null 									&& (as.getMaxInactiveInterval()*1000 < System.currentTimeMillis() - as.getLastAccessedTime()									|| !as.isValid())) {  //log("sesion is timeouted, last accessed " + new Date(as.getLastAccessedTime()));									// hashtable is synchronized impl									as = (AcmeSession)sessions.remove(sid);									if (as != null && as.isValid()) 										try {											as.invalidate();										} catch(IllegalStateException ise) {																					}								}							}						}					}				}				}, "Session cleaner");			t.setPriority(Thread.MIN_PRIORITY);			t.start();		} else 			expiredIn = -expiredIn;        System.out.println("WebServer :"+port+" is ready.");        try        {            while ( running )            {                Socket socket = serverSocket.accept();                new ServeConnection( socket, this );            }        }        catch ( IOException e )        {            log( "Accept: " + e );        }        finally        {            try            {                serverSocket.close();            }            catch ( IOException e ) {}            destroyAllServlets();        }    }		public static interface SocketFactory {		public ServerSocket createSocket(Hashtable arguments) throws IOException, IllegalArgumentException;	}		protected ServerSocket createServerSocket() throws IOException {		String socketFactoryClass = (String)arguments.get(ARG_SOCKET_FACTORY);		if (socketFactoryClass != null) 		try {			return ((SocketFactory)Class.forName(socketFactoryClass).newInstance() ).createSocket(arguments);		} catch(Exception e) {			System.err.println("Couldn't create custom socket factory "+socketFactoryClass							   +" or call creation method. Standard socket will be created. "+e);		}		return new ServerSocket( port, 1000 );	}        // Methods from ServletContext.           /// Gets a servlet by name.    // @param name the servlet name    // @return null if the servlet does not exist	public Servlet getServlet( String name ) { 		try {		   return (Servlet) ((Object[])registry.get( name ))[0];		} catch(NullPointerException npe) {			return null;		}    }        /// Enumerates the servlets in this context (server). Only servlets that    // are accesible will be returned.  This enumeration always includes the    // servlet itself.    public Enumeration getServlets()    {        return registry.elements();    }        /// Enumerates the names of the servlets in this context (server). Only    // servlets that are accesible will be returned.  This enumeration always    // includes the servlet itself.    public Enumeration getServletNames()    {        return registry.keys();    }    /// Destroys all currently-loaded servlets.    public void destroyAllServlets()    {        Enumeration en = registry.elements();        while ( en.hasMoreElements() )        {            Servlet servlet = (Servlet) en.nextElement();             servlet.destroy();        }	registry = new PathTreeDictionary();        // invalidate all sessions?    }        public void setMappingTable(PathTreeDictionary mappingtable)    {        this.mappingtable = mappingtable;    }        public void setRealms(PathTreeDictionary realms)    {        this.realms = realms;    }		Object getSession(String id) {		   return sessions.get(id);	}		HttpSession createSession() {		HttpSession result = new AcmeSession(generateSessionId(), expiredIn*60, this, sessions);		sessions.put(result.getId(), result);		return result;	}		void removeSession(String id) {		sessions.remove(id);	}	    /// Write information to the servlet log.    // @param message the message to log    public void log( String message )    {        Date date = new Date( System.currentTimeMillis() );        logStream.println( "[" + date.toString() + "] " + message );    }        public void log(String message, Throwable throwable)    {        StringWriter sw=new StringWriter();        throwable.printStackTrace(new PrintWriter(sw));        log(message+'\n'+sw);    }        /// Write a stack trace to the servlet log.    // @param exception where to get the stack trace    // @param message the message to log    public void log( Exception exception, String message )    {        StringWriter sw=new StringWriter();        exception.printStackTrace(new PrintWriter(sw));        log( ""+sw+'\n'+message );    }        /// Applies alias rules to the specified virtual path and returns the    // corresponding real path.  It returns null if the translation    // cannot be performed.    // @param path the path to be translated	public String getRealPath( String path ) { 		//System.err.print("["+path+"]->[");		try { // this code only for debug purpose			// check if it absolute URL			URL url = new URL(path);			path = url.getFile();			new Exception("URL "+path+" specified in getRealPath").printStackTrace();			path = null;		} catch (MalformedURLException mfue) {		}		if (mappingtable != null) { 			// try find first sub-path			Object [] os = mappingtable.get(path);			if (os[0] == null)				return null;			int slpos = ((Integer)os[1]).intValue();			if (path.length() > slpos && slpos > 0) {				path = path.substring(slpos+1);			} else if (path.length() > 0) {				char s = path.charAt(0);				if(s == '/' || s == '\\')					path = path.substring(1);			}			//System.err.println("Base:"+((String)os[0])+"\npath="+path+"\n pos="+slpos+']');			return ((String)os[0])+File.separatorChar+path;		}		return path;	}    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
67194成人在线观看| 成人高清伦理免费影院在线观看| 久久先锋影音av鲁色资源| 欧美色精品在线视频| 91影视在线播放| 91在线视频官网| 在线观看免费成人| 欧美肥胖老妇做爰| 日韩一区二区三区av| 精品剧情在线观看| 国产欧美一区二区在线| 久久九九影视网| 国产精品美女久久久久久| 最新日韩在线视频| 亚州成人在线电影| 久久精品国产久精国产爱| 蜜臀91精品一区二区三区| 国产在线国偷精品免费看| 丰满白嫩尤物一区二区| 91香蕉视频黄| 777a∨成人精品桃花网| 久久夜色精品国产噜噜av| 国产精品欧美一区喷水| 亚洲高清免费一级二级三级| 美脚の诱脚舐め脚责91| 高清视频一区二区| 欧美曰成人黄网| 日韩欧美一卡二卡| 国产精品久久久久久一区二区三区| 亚洲蜜臀av乱码久久精品 | 精品国产免费一区二区三区四区 | 91色综合久久久久婷婷| 欧美三级电影在线看| 欧美草草影院在线视频| 亚洲欧洲日产国码二区| 老司机精品视频一区二区三区| 国产乱国产乱300精品| 欧洲视频一区二区| 欧美精品一区二区三区在线播放 | 高清视频一区二区| 欧美二区在线观看| 国产精品国产自产拍在线| 午夜视频一区在线观看| 国产福利一区二区三区视频在线 | 一本色道综合亚洲| 久久久亚洲精品石原莉奈| 亚洲一区二区三区四区在线观看 | 欧美吻胸吃奶大尺度电影| 久久亚区不卡日本| 日韩和的一区二区| 91在线视频播放地址| 久久欧美一区二区| 五月天精品一区二区三区| 国产精品1区二区.| 日韩一级片在线观看| 尤物在线观看一区| eeuss国产一区二区三区| 日韩三级精品电影久久久| 亚洲精品久久7777| 99re8在线精品视频免费播放| 精品国内二区三区| 日本最新不卡在线| 欧美日本高清视频在线观看| 亚洲激情图片qvod| 91麻豆免费看| 亚洲私人黄色宅男| 成人动漫av在线| 日本一二三不卡| 国产91露脸合集magnet| 精品剧情在线观看| 精品一区在线看| 欧美一区二区三区视频| 天使萌一区二区三区免费观看| 欧洲av在线精品| 亚洲国产精品久久久久秋霞影院| 色欧美日韩亚洲| 一区二区三区四区在线播放| 99久久国产综合精品女不卡| 中文字幕一区二| 成人99免费视频| 亚洲激情在线播放| 精品视频一区 二区 三区| 亚洲午夜久久久久久久久电影网| 91官网在线免费观看| 亚洲午夜免费电影| 日韩欧美一区中文| 国产毛片精品一区| 中文字幕在线不卡| 色综合久久天天| 午夜精品福利视频网站| 91精品国产色综合久久| 激情六月婷婷综合| 欧美激情一区二区三区| 91亚洲男人天堂| 午夜精品123| 亚洲精品一区二区三区精华液| 另类人妖一区二区av| 久久伊99综合婷婷久久伊| 国产成人一级电影| 一区二区三区精品在线观看| 91福利区一区二区三区| 日韩精品91亚洲二区在线观看| 欧美大白屁股肥臀xxxxxx| 丁香婷婷综合色啪| 亚洲一区二区三区四区的 | 国产999精品久久久久久| 国产精品盗摄一区二区三区| 欧美日韩精品专区| 国产成人综合精品三级| 亚洲精品美腿丝袜| 欧美不卡一区二区三区四区| 国产精品一区二区x88av| 亚洲狠狠爱一区二区三区| 久久夜色精品一区| 欧美日韩国产一级| 国产成人欧美日韩在线电影| 亚洲欧美日韩久久精品| 日韩精品一区二区三区中文精品| 成人丝袜18视频在线观看| 亚洲成人免费看| 日韩精品成人一区二区在线| 久久婷婷国产综合国色天香| 91视频精品在这里| 久久成人精品无人区| 成人免费在线视频| 久久亚洲精华国产精华液| 欧美精品久久一区| 99热国产精品| 国产剧情av麻豆香蕉精品| 亚洲综合激情另类小说区| 国产精品沙发午睡系列990531| 欧美精品视频www在线观看 | 日韩写真欧美这视频| 91视频www| www.在线欧美| 国产福利一区二区三区| 国内精品嫩模私拍在线| 三级在线观看一区二区| 亚洲精品日日夜夜| 中文字幕亚洲精品在线观看| 精品国产乱码久久久久久影片| 欧美日韩国产三级| 在线视频国内一区二区| www.爱久久.com| 成人性生交大合| 风间由美一区二区av101| 青青草国产精品亚洲专区无| 亚洲成av人片一区二区三区| 亚洲精品水蜜桃| 一区二区三区四区蜜桃| 中文字幕一区二区三中文字幕| 精品国产伦一区二区三区免费| 日韩一级视频免费观看在线| 欧美大片一区二区三区| 亚洲日本欧美天堂| 一区二区三区日韩精品视频| 亚洲欧美日韩小说| 一区二区三区日韩| 亚洲成人免费在线| 麻豆成人久久精品二区三区红| 亚洲成av人片观看| 看片的网站亚洲| 免费久久99精品国产| 精品一区中文字幕| 成人av影院在线| 91丨porny丨在线| 欧美视频一区二区在线观看| 欧美日韩国产美女| 日韩一区二区三区av| 欧美激情一区二区在线| 1024精品合集| 午夜一区二区三区在线观看| 免费一级欧美片在线观看| 国产成人午夜精品5599| eeuss国产一区二区三区| 欧美精品在线视频| 精品国产乱码久久久久久久| 欧美激情一区二区三区不卡| 一区二区三区四区不卡在线 | 亚洲视频一二三| 天堂影院一区二区| 国产乱子轮精品视频| 91女厕偷拍女厕偷拍高清| 欧美日韩高清影院| 精品国产欧美一区二区| 一区视频在线播放| 日本中文一区二区三区| 成人黄色在线看| 精品视频1区2区| 2024国产精品| 夜夜爽夜夜爽精品视频| 国产乱码精品一区二区三区忘忧草| 91蜜桃在线观看| 精品国产一区二区三区四区四 | 日韩电影免费在线| 99久久99久久免费精品蜜臀| 91麻豆精品国产| 樱花影视一区二区| 福利一区在线观看| 欧美一卡在线观看|