public static PatchMetadataResolver parse(final InputStream stream) throws XMLStreamException { return parse(stream, null); }
public static PatchMetadataResolver parse(final File patchXml) throws IOException, XMLStreamException { return parse(patchXml, null); }
public static PatchMetadataResolver parse(final InputStream stream) throws XMLStreamException { return parse(stream, null); }
public static PatchMetadataResolver parse(final File patchXml) throws IOException, XMLStreamException { return parse(patchXml, null); }
public static PatchMetadataResolver parse(final Reader stream) throws XMLStreamException { return parse(stream, null); }
public static PatchMetadataResolver parse(final File patchXml, InstalledIdentity original) throws IOException, XMLStreamException { try (final InputStream is = new FileInputStream(patchXml)){ return parse(is, original); } }
public static PatchMetadataResolver parse(final File patchXml, InstalledIdentity original) throws IOException, XMLStreamException { try (final InputStream is = new FileInputStream(patchXml)){ return parse(is, original); } }
private PatchMetadataResolver parsePatchXml(final File patchXml) throws XMLStreamException, IOException { InputStream patchIS = null; try { patchIS = new FileInputStream(patchXml); return PatchXml.parse(patchIS); } finally { safeClose(patchIS); } }
private PatchMetadataResolver parsePatchXml(final File patchXml) throws XMLStreamException, IOException { InputStream patchIS = null; try { patchIS = new FileInputStream(patchXml); return PatchXml.parse(patchIS); } finally { safeClose(patchIS); } }
public static PatchMetadataResolver parse(final Reader reader, InstalledIdentity originalIdentity) throws XMLStreamException { return parse(getXMLInputFactory().createXMLStreamReader(reader), originalIdentity); }
public static PatchMetadataResolver parse(final InputStream stream, InstalledIdentity originalIdentity) throws XMLStreamException { return parse(getXMLInputFactory().createXMLStreamReader(stream), originalIdentity); }
public static PatchMetadataResolver parse(final Reader reader, InstalledIdentity originalIdentity) throws XMLStreamException { return parse(getXMLInputFactory().createXMLStreamReader(reader), originalIdentity); }
static RollbackPatch loadRollbackInformation(final String patchId, final InstalledImage installedImage) throws PatchingException, IOException, XMLStreamException { final File historyDir = installedImage.getPatchHistoryDir(patchId); final File patchXml = new File(historyDir, Constants.ROLLBACK_XML); return (RollbackPatch) PatchXml.parse(patchXml).resolvePatch(null, null); }
static RollbackPatch loadRollbackInformation(final String patchId, final InstalledImage installedImage) throws PatchingException, IOException, XMLStreamException { final File historyDir = installedImage.getPatchHistoryDir(patchId); final File patchXml = new File(historyDir, Constants.ROLLBACK_XML); return (RollbackPatch) PatchXml.parse(patchXml).resolvePatch(null, null); }
static Patch loadPatchInformation(final String patchId, final InstalledImage installedImage) throws PatchingException, IOException, XMLStreamException { final File patchDir = installedImage.getPatchHistoryDir(patchId); final File patchXml = new File(patchDir, PatchXml.PATCH_XML); return PatchXml.parse(patchXml).resolvePatch(null, null); }
private static Patch parsePatchXml(final File patch1Dir, File patch1) throws PatchingException { final File patch1Xml = new File(patch1Dir, PatchXml.PATCH_XML); if (!patch1Xml.exists()) { throw new PatchingException("Failed to locate " + PatchXml.PATCH_XML + " in " + patch1.getAbsolutePath()); } try { return PatchXml.parse(patch1Xml).resolvePatch(null, null); } catch (Exception e) { throw new PatchingException("Failed to parse " + PatchXml.PATCH_XML + " from " + patch1.getAbsolutePath(), e); } }
static Patch loadPatchInformation(final String patchId, final InstalledImage installedImage) throws PatchingException, IOException, XMLStreamException { final File patchDir = installedImage.getPatchHistoryDir(patchId); final File patchXml = new File(patchDir, PatchXml.PATCH_XML); return PatchXml.parse(patchXml).resolvePatch(null, null); }
private static Patch parsePatchXml(final File patch1Dir, File patch1) throws PatchingException { final File patch1Xml = new File(patch1Dir, PatchXml.PATCH_XML); if (!patch1Xml.exists()) { throw new PatchingException("Failed to locate " + PatchXml.PATCH_XML + " in " + patch1.getAbsolutePath()); } try { return PatchXml.parse(patch1Xml).resolvePatch(null, null); } catch (Exception e) { throw new PatchingException("Failed to parse " + PatchXml.PATCH_XML + " from " + patch1.getAbsolutePath(), e); } }
private void doMarshall(String fileName) throws Exception { final String original = toString(fileName); try (final InputStream is = getResource(fileName)) { final Patch patch = PatchXml.parse(is).resolvePatch(null, null); final StringWriter writer = new StringWriter(); PatchXml.marshal(writer, patch); final String marshalled = writer.toString(); XMLUtils.compareXml(original, marshalled, false); } }
@Test public void testParseOneOff() throws Exception { final InputStream is = getResource("patch-02-ONE-OFF.xml"); final Patch patch = PatchXml.parse(is).resolvePatch(null, null); // One-off Patch assertNotNull(patch); assertNotNull(patch.getPatchId()); assertNotNull(patch.getDescription()); final Identity identity = patch.getIdentity(); assertNotNull(identity); assertNotNull(patch.getIdentity().getVersion()); }