/** * Create a FilteredInputStream that excludes the the atyponBaseFilters and moreNodes * * @param au The archival unit * @param in Incoming input stream * @param encoding The encoding * @param moreNodes An array of NodeFilters to be excluded with atyponBaseFilters */ public InputStream createFilteredInputStream( ArchivalUnit au, InputStream in, String encoding, NodeFilter[] moreNodes) throws PluginException { NodeFilter[] bothFilters = addTo(moreNodes); return new HtmlFilterInputStream( in, encoding, HtmlNodeFilterTransform.exclude(new OrFilter(bothFilters))); }
public InputStream createFilteredInputStream(ArchivalUnit au, InputStream in, String encoding) { NodeFilter[] filters = new NodeFilter[] { // filter out script new TagNameFilter("script"), // Menu and related articles/other issues HtmlNodeFilters.tagWithAttribute("div", "class", "A_Left_Column"), // Footer menu that seems to currently be blank HtmlNodeFilters.tagWithAttribute("div", "class", "A_Foot_Menu"), // Copyright HtmlNodeFilters.tagWithAttribute("div", "class", "A_Foot_Copy"), // Lazy HTML these are inserted everywhere in an attempt to get the layout to work HtmlNodeFilters.tagWithAttribute("div", "style", "clear:both;"), // search box with broken layout. they may try to fix this HtmlNodeFilters.tagWithAttribute("div", "id", "search"), // another blank navigation div HtmlNodeFilters.tagWithAttribute("div", "id", "Sub_Top_Nav"), }; return new HtmlFilterInputStream( in, encoding, HtmlNodeFilterTransform.exclude(new OrFilter(filters))); }
/** * Create a FilteredInputStream that excludes the the atyponBaseFilters * * @param au The archival unit * @param in Incoming input stream * @param encoding The encoding */ public InputStream createFilteredInputStream(ArchivalUnit au, InputStream in, String encoding) throws PluginException { return new HtmlFilterInputStream( in, encoding, HtmlNodeFilterTransform.exclude(new OrFilter(baseAtyponFilters))); }