?? librarybean.java
字號:
// **********************************************************************// <copyright>// BBN Technologies// 10 Moulton Street// Cambridge, MA 02138// (617) 873-8000// // Copyright (C) BBNT Solutions LLC. All rights reserved.// </copyright>// **********************************************************************// $Source: /cvs/distapps/openmap/src/vpfservlet/WEB-INF/src/com/bbn/openmap/vpfservlet/LibraryBean.java,v $// $Revision: 1.2.2.2 $ $Date: 2005/08/11 21:03:09 $ $Author: dietrick $// **********************************************************************package com.bbn.openmap.vpfservlet;import javax.servlet.ServletContext;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.bbn.openmap.io.FormatException;import com.bbn.openmap.layer.vpf.LibrarySelectionTable;/** * This class prints out a description of a VPF database, listing the * available libraries, coverage types and feature types. */public class LibraryBean { private LibrarySelectionTable lst; private HttpServletRequest request; private HttpServletResponse response; public void setContext(ServletContext c) { contextInfo = ContextInfo.getContextInfo(c); } public void setResponse(HttpServletResponse r) { response = r; } public HttpServletRequest getRequest() { return request; } public void setRequest(HttpServletRequest request) { this.request = request; } public HttpServletResponse getResponse() { return response; } public LibrarySelectionTable getLst() { return lst; } public String getLibName() { return (lst == null) ? "unknown" : lst.getDatabaseName(); } public void setPath(String pathInfo) { if (pathInfo == null) { return; } int findex = pathInfo.indexOf('/', 1); if (findex < 0) { findex = pathInfo.length(); } String libname = pathInfo.substring(0, findex); try { lst = getLST(libname); if (lst == null) { return; } // String dbname = lst.getDatabaseName(); // out.println("<HTML>\n<HEAD><TITLE>Describe VPF Database // " + // dbname + "</TITLE></HEAD>\n<BODY>\n<H1>VPF Database " + // dbname + "</H1>\n"); // ListElement dble = new ListBodyElement(); // WrapElement dblist = new WrapElement("ul", dble); // dble.addElement("Database Description: " + // lst.getDatabaseDescription()); // dble.addElement("Database Description Table: " + // buildURL(request, response, libname, "dht")); // String[] libraries = lst.getLibraryNames(); // StringBuffer libnames = new StringBuffer("Database // Libraries: "); // for (int i = 0; i < libraries.length; i++) { // libnames.append("<A HREF=\"#").append(libraries[i]); // libnames.append("\">").append(libraries[i]); // libnames.append("</A>").append(" "); // } // libnames.append("(from "); // libnames.append(buildURL(request, response, libname, // "lat")); // libnames.append(")"); // dble.addElement(libnames.toString()); // dblist.generate(out); // for (int i = 0; i < libraries.length; i++) { // String prefix = libraries[i] + ":"; // printLibrary(request, response, libname, // lst.getCAT(libraries[i])); // } // out.println("</body></html>"); } catch (FormatException fe) { // throw new ServletException("FormatException: " , fe); } } /** the context object used for config info */ protected ContextInfo contextInfo; public LibrarySelectionTable getLST(String libname) throws FormatException { LibrarySelectionTable lst = contextInfo.getLST(libname); if (lst == null) { String lib_home = contextInfo.getPath(libname); if (lib_home == null) { return null; } lst = new LibrarySelectionTable(lib_home); contextInfo.putLST(libname, lst); } return lst; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -