⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lowresimagefilter.java

📁 一款Java实现的HTTP代理服务器
💻 JAVA
字号:
package rabbit.filter;import rabbit.html.HtmlBlock;import rabbit.html.Tag;import rabbit.html.TagType;import rabbit.http.HttpHeader;import rabbit.proxy.Connection;/** This filter removes the &quot;<tt>lowsrc=some_image.gif</tt>&quot; attributes *  from the &lt;img&gt; tags. * * @author <a href="mailto:robo@khelekore.org">Robert Olofsson</a> */public class LowresImageFilter extends SimpleTagFilter {    // For the factory.    public LowresImageFilter () {    }    /** Create a new LowresImageFilter for the given request, response pair.     * @param con the Connection handling the request.     * @param request the actual request made.     * @param response the actual response being sent.     */    public LowresImageFilter (Connection con, HttpHeader request, HttpHeader response) {		super (con, request, response);    }    @Override public HtmlFilter newFilter (Connection con, 					   HttpHeader request, 					   HttpHeader response) {	return new LowresImageFilter (con, request, response);    }    /** remove the lowres tags.     * @param block the part of the html page we are filtering.     */    public void handleTag (Tag tag, HtmlBlock block, int tokenIndex) {	if (tag.getTagType () == TagType.IMG)	    tag.removeAttribute ("lowsrc");    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -