/** * Create a new Reader with XML encoding detection rules. * * @param in not null input stream. * @return an XML reader instance for the input stream. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( InputStream in ) throws IOException { return new XmlStreamReader( in ); }
/** * Create a new Reader with XML encoding detection rules. * * @param url not null url. * @return an XML reader instance for the input url. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( URL url ) throws IOException { return new XmlStreamReader( url ); }
/** * Create a new Reader with XML encoding detection rules. * * @param file not null file. * @return an XML reader instance for the input file. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( File file ) throws IOException { return new XmlStreamReader( file ); }
/** * Create a new Reader with XML encoding detection rules. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( File file ) throws IOException { return new XmlStreamReader( file ); }
/** * Create a new Reader with XML encoding detection rules. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( InputStream in ) throws IOException { return new XmlStreamReader( in ); }
/** * Create a new Reader with XML encoding detection rules. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( URL url ) throws IOException { return new XmlStreamReader( url ); }
/** * Create a new Reader with XML encoding detection rules. * * @param file not null file. * @return an XML reader instance for the input file. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( File file ) throws IOException { return new XmlStreamReader( file ); }
/** * Create a new Reader with XML encoding detection rules. * * @param in not null input stream. * @return an XML reader instance for the input stream. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( InputStream in ) throws IOException { return new XmlStreamReader( in ); }
/** * Create a new Reader with XML encoding detection rules. * * @param url not null url. * @return an XML reader instance for the input url. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( URL url ) throws IOException { return new XmlStreamReader( url ); }
private static Xpp3Dom parseXmlItem(final StorageFileItem item) throws IOException, XmlPullParserException { try (InputStream is = item.getInputStream()) { return Xpp3DomBuilder.build(new XmlStreamReader(is)); } }
private Xpp3Dom getMirrorsDom(final StorageFileItem mirrorsItem) throws IOException, XmlPullParserException { try (InputStream is = mirrorsItem.getInputStream()) { return Xpp3DomBuilder.build(new XmlStreamReader(is)); } }
private static Xpp3Dom parseJarItem(final StorageFileItem item, final String jarPath) throws IOException, XmlPullParserException { final File file = File.createTempFile("p2file", "zip"); try { try (InputStream is = item.getInputStream()) { FileUtils.copyInputStreamToFile(is, file); try (ZipFile z = new ZipFile(file)) { final ZipEntry ze = z.getEntry(jarPath); if (ze == null) { throw new LocalStorageException("Corrupted P2 metadata jar " + jarPath); } try (InputStream zis = z.getInputStream(ze)) { return Xpp3DomBuilder.build(new XmlStreamReader(zis)); } } } } finally { file.delete(); } } }
private static Map<String, String> parse(final InputStream in) { try { final Map<String, String> locations = Maps.newHashMap(); final Xpp3Dom dom = Xpp3DomBuilder.build(new XmlStreamReader(in)); for (final Xpp3Dom data : dom.getChildren("data")) { final Xpp3Dom location = data.getChild("location"); final String type = data.getAttribute("type"); final String href = location.getAttribute("href"); locations.put(type, href); } return locations; } catch (Exception e) { throw Throwables.propagate(e); } }
private static Map<String, String> parse(final InputStream in) { try { final Map<String, String> locations = Maps.newHashMap(); final Xpp3Dom dom = Xpp3DomBuilder.build(new XmlStreamReader(in)); for (final Xpp3Dom data : dom.getChildren("data")) { final Xpp3Dom location = data.getChild("location"); final String type = data.getAttribute("type"); final String href = location.getAttribute("href"); locations.put(type, href); } return locations; } catch (Exception e) { throw Throwables.propagate(e); } }
FileInputStream is = new FileInputStream(platform); try { XmlStreamReader reader = new XmlStreamReader(is); Xpp3Dom dom = Xpp3DomBuilder.build(reader); Xpp3Dom[] sites = dom.getChildren("site");
FileInputStream is = new FileInputStream(platform); try { XmlStreamReader reader = new XmlStreamReader(is); Xpp3Dom dom = Xpp3DomBuilder.build(reader); Xpp3Dom[] sites = dom.getChildren("site");
XmlStreamReader reader = new XmlStreamReader(is);
Xpp3Dom dom; try { dom = Xpp3DomBuilder.build(new XmlStreamReader(artifactMappingsItem.getInputStream()));
dom = Xpp3DomBuilder.build(new XmlStreamReader(new File(metadataRepositoryDir, "content.xml")));
dom = Xpp3DomBuilder.build(new XmlStreamReader(new File(artifactRepositoryDir, "artifacts.xml"))); storeItemFromFile(P2Constants.ARTIFACT_MAPPINGS_XML, artifactMappingsXmlFile, repository); repository.initArtifactMappingsAndMirrors();