@Test public void parse2() throws FileNotFoundException, IOException { File path = new File(System.getProperty("user.dir"), "src"); path = new File(path, "test"); path = new File(path, "resources"); Set<Link> links = fixture.parse(new ParseContext(null, path.getAbsolutePath() + "/Linux_at_Home_Links.xbel", path.getAbsolutePath() + "/Linux_at_Home_Links.xbel")); assertNotNull(links); assertEquals(232, links.size()); }
@Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(context.getFileName())); Node root = doc.getDocumentElement(); parseNodeList(root.getChildNodes(), new ArrayList<>()); } catch (ParserConfigurationException | SAXException ex) { } return getLinks(); }
XbelParser extends AbstractParser { @Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(context.getFileName())); Node root = doc.getDocumentElement(); parseNodeList(root.getChildNodes(), new ArrayList<>()); } catch (ParserConfigurationException | SAXException ex) { } return getLinks(); } }
XbelParser extends AbstractParser { @Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(context.getFileName())); Node root = doc.getDocumentElement(); parseNodeList(root.getChildNodes(), new ArrayList<>()); } catch (ParserConfigurationException | SAXException ex) { } return getLinks(); } XbelParser(); }
XbelParser extends AbstractParser { @Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(context.getFileName())); Node root = doc.getDocumentElement(); parseNodeList(root.getChildNodes(), new ArrayList<>()); } catch (ParserConfigurationException | SAXException ex) { } return getLinks(); } XbelParser(); @Override String getName(); @Override boolean canParse(ParseContext context); @Override Set<Link> parse(ParseContext context); }
XbelParser extends AbstractParser { @Override public Set<Link> parse(ParseContext context) throws IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(context.getFileName())); Node root = doc.getDocumentElement(); parseNodeList(root.getChildNodes(), new ArrayList<>()); } catch (ParserConfigurationException | SAXException ex) { } return getLinks(); } XbelParser(); @Override String getName(); @Override boolean canParse(ParseContext context); @Override Set<Link> parse(ParseContext context);  }