📄 brokenlinkfilter.java
字号:
/* * BrokenLinkFilter.java * * Created on 4. April 2004, 17:21 */package de.spieleck.app.jacson.filter;import de.spieleck.app.jacson.JacsonException;import java.io.IOException;import java.net.URL;import java.io.InputStream;/** * This filter checks if a given chunk, treated as URL works, i.e. the given * ressource is reachable * <br> * @author Patrick Carl * @since 0.89 * @version $Id: BrokenLinkFilter.java 13 2005-09-28 06:02:56Z pcs $ */public class BrokenLinkFilter extends ConstFilter{ /** * filters the given chunk out if <ul> * <li>the given chunk represents a working URL and this filter is set to * inverse</li> * <li>the given chunk represents no working URL and this filter is not * set to inverse</li> * </ul> * */ public void putChunk(String chunk) throws JacsonException { try{ URL url = new URL(chunk); InputStream is = url.openStream(); if(inverse) drain.putChunk(chunk); is.close(); } catch (IOException broken){ if(!inverse) drain.putChunk(chunk); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -