protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(source); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(stream); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(reader); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(reader); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(stream); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(file); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(file); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(source); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(uri.toString()); } };
protected GPathResult method(XmlSlurper slurper) throws Exception { return slurper.parse(uri.toString()); } };
/** * A helper method to parse the given text as XML * * @param text a String containing XML to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parseText(final String text) throws IOException, SAXException { return parse(new StringReader(text)); }
/** * Parse the content of the specified URI into a GPathResult Object * * @param uri a String containing the URI to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parse(final String uri) throws IOException, SAXException { return parse(new InputSource(uri)); }
/** * Parse the content of the specified input stream into an GPathResult Object. * Note that using this method will not provide the parser with any URI * for which to find DTDs etc. It is up to you to close the InputStream * after parsing is complete (if required). * * @param input the InputStream to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parse(final InputStream input) throws IOException, SAXException { return parse(new InputSource(input)); }
/** * Parse the content of the specified reader into a GPathResult Object. * Note that using this method will not provide the parser with any URI * for which to find DTDs etc. It is up to you to close the Reader * after parsing is complete (if required). * * @param in the Reader to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parse(final Reader in) throws IOException, SAXException { return parse(new InputSource(in)); }
/** * Parses the content of the given file as XML turning it into a GPathResult object * * @param file the File to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parse(final File file) throws IOException, SAXException { final FileInputStream fis = new FileInputStream(file); final InputSource input = new InputSource(fis); input.setSystemId("file://" + file.getAbsolutePath()); try { return parse(input); } finally { fis.close(); } }
/** * Parse the content of the specified URI into a GPathResult Object * * @param uri a String containing the URI to parse * @return An object which supports GPath expressions * @throws SAXException Any SAX exception, possibly wrapping another exception. * @throws IOException An IO exception from the parser, possibly from a byte stream * or character stream supplied by the application. */ public GPathResult parse(final String uri) throws IOException, SAXException { return parse(new InputSource(uri)); }
/** * A helper method to parse the given text as XML * * @param text * @return An object which supports GPath expressions */ public GPathResult parseText(final String text) throws IOException, SAXException { return parse(new StringReader(text)); }
public static List<String> getLauncherIcons(File manifestFile) throws SAXException, IOException { GPathResult manifestXml = xmlSlurper.parse(manifestFile); GPathResult applicationNode = (GPathResult) manifestXml.getProperty("application"); String icon = String.valueOf(applicationNode.getProperty("@android:icon")); String roundIcon = String.valueOf(applicationNode.getProperty("@android:roundIcon")); List<String> icons = new ArrayList<>(2); if (!icon.isEmpty()) icons.add(icon); if (!roundIcon.isEmpty()) icons.add(roundIcon); return unmodifiableList(icons); }
public String parse(InputStream stream) { try { return translate(newXmlSlurper().parse(stream)); } catch (IOException | SAXException e) { throw new IllegalArgumentException(e); } }
public String parse(File file) { try { return translate(newXmlSlurper().parse(file)); } catch (IOException | SAXException e) { throw new IllegalArgumentException(e); } }