Changeset 36103
- Timestamp:
- 2022-03-11T10:07:12+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone3/ServletConfiguration.java
r26004 r36103 63 63 private String gsdl3_path = ""; 64 64 private ArrayList sites = null; 65 private HashMap mappings = null; 65 private HashMap site_to_servlet_list_map = null; 66 private HashMap servlet_to_site_map = null; 66 67 67 68 public ServletConfiguration(String gsdl3_path) { … … 71 72 if (Gatherer.isGsdlRemote){ 72 73 if (Gatherer.remoteGreenstoneServer.downloadWebXMLFile().equals("")) { 73 System.err.println(" Error: Could not download web.xml.");74 System.err.println("ServletConfiguration Error: Could not download web.xml."); 74 75 System.exit(0); 75 76 } … … 92 93 if (sites_on_server.equals("")) { 93 94 // !! Something went wrong : could not get names of the sites 94 System.err.println(" Error: Could not get names of the sites.");95 System.err.println("ServletConfiguration Error: Could not get names of the sites."); 95 96 System.exit(0); 96 97 } … … 115 116 } 116 117 117 this.mappings = new HashMap(); 118 this.site_to_servlet_list_map = new HashMap(); 119 this.servlet_to_site_map = new HashMap(); 118 120 Document web_config = XMLTools.parseXMLFile(web_xml.getAbsolutePath(), false); 119 121 … … 137 139 138 140 if (site != null) { 139 ArrayList this_site = (ArrayList) mappings.get(site);141 ArrayList this_site = (ArrayList)site_to_servlet_list_map.get(site); 140 142 if (this_site == null) { 141 143 this_site = new ArrayList(); … … 146 148 } 147 149 this_site.add(url); 148 mappings.put(site, this_site); 150 this.site_to_servlet_list_map.put(site, this_site); 151 this.servlet_to_site_map.put(url, site); 149 152 } 150 153 … … 160 163 161 164 public ArrayList getServletsForSite(String site) { 162 return (ArrayList)this. mappings.get(site);165 return (ArrayList)this.site_to_servlet_list_map.get(site); 163 166 } 164 167 public String getServletPath(String site) { 165 168 166 169 // for now, get the first one 167 ArrayList servlets = (ArrayList) mappings.get(site);170 ArrayList servlets = (ArrayList)this.site_to_servlet_list_map.get(site); 168 171 if(servlets == null) { 169 172 return null; 170 173 } 171 174 return (String)servlets.get(0); 175 } 176 177 public String getSiteForServlet(String servlet) { 178 return (String)this.servlet_to_site_map.get(servlet); 172 179 } 173 180
Note:
See TracChangeset
for help on using the changeset viewer.