1 16 17 package org.apache.jetspeed.services.webpage; 18 19 import java.io.IOException ; 21 22 import javax.servlet.http.*; 24 25 import java.net.URLConnection ; 27 28 import org.apache.log4j.Logger; 29 30 import org.apache.jetspeed.util.rewriter.HTMLRewriter; 31 32 44 45 public class JetspeedSiteSession extends AbstractSiteSession 46 { 47 48 Site site; 49 50 String userName; 52 53 static Logger log = Logger.getLogger(JetspeedSiteSession.class); 55 56 63 public JetspeedSiteSession(Site site, 64 String proxyBase, 65 String userName) 66 { 67 super(site.getURL(), proxyBase); 68 this.site = site; 69 this.userName = userName; 70 } 71 72 81 public boolean logon(ProxyRunData data) 82 throws IOException 83 { 84 return true; 85 } 86 87 88 98 99 public void rewriteContent(ProxyRunData data, 100 URLConnection con, 101 int contentType, 102 String url) throws IOException 103 { 104 String content = getHTMLContent(con, data, url); 106 if (WebPageHelper.CT_HTML == contentType) 107 { 108 HTMLRewriter rewriter = new HTMLRewriter (); } 113 else 114 data.getResponse().getWriter().write(content); 115 116 } 117 118 125 public void drainContent(URLConnection con, 126 HttpServletResponse response) throws IOException 127 { 128 } 130 131 141 public String getContentAsString(URLConnection con, 142 ProxyRunData data, 143 String url) 144 throws IOException 145 { 146 return ""; } 148 149 150 151 156 public Site getSite() 157 { 158 return site; 159 } 160 161 166 public String getUserName() 167 { 168 return userName; 169 } 170 171 181 public boolean logout(ProxyRunData data) 182 throws IOException 183 { 184 return true; } 186 187 public void proxy(String site, ProxyRunData data) 188 throws IOException 189 { 190 } 191 192 } 193 194 | Popular Tags |