/** * Constructor. * * @param stream * content of the filter file * @throws IOException */ public Filter(InputStream stream) throws IOException { try { parse("", stream); } catch (SAXException e) { throw new IOException(e.getMessage()); } }
/** * Constructor. * * @param fileName * name of the filter file * @throws IOException */ public Filter(String fileName) throws IOException { try { parse(fileName); } catch (SAXException e) { throw new IOException(e.getMessage()); } }
/** * Parse and load the given filter file. * * @param fileName * name of the filter file * @throws IOException * @throws SAXException * @throws FilterException */ private void parse(String fileName) throws IOException, SAXException { FileInputStream fileInputStream = new FileInputStream(new File(fileName)); parse(fileName, fileInputStream); }
/** * Constructor. * * @param fileName * name of the filter file * @throws IOException */ public Filter(String fileName) throws IOException { try { parse(fileName); } catch (SAXException e) { throw new IOException(e.getMessage()); } }
/** * Constructor. * * @param stream * content of the filter file * @throws IOException */ public Filter(InputStream stream) throws IOException { try { parse("", stream); } catch (SAXException e) { throw new IOException(e.getMessage()); } }
/** * Parse and load the given filter file. * * @param fileName * name of the filter file * @throws IOException * @throws SAXException * @throws FilterException */ private void parse(String fileName) throws IOException, SAXException { FileInputStream fileInputStream = new FileInputStream(new File(fileName)); parse(fileName, fileInputStream); }