} else { is = patchZip.getInputStream(patchXmlEntry); final List<BundledPatchEntry> patches = PatchBundleXml.parse(is).getPatches(); displayPatchBundleXml(ctx, patches, patchZip);
final List<BundledPatch.BundledPatchEntry> entries = new ArrayList<BundledPatch.BundledPatchEntry>(metadata.getPatches()); for (final File patch : patches) { final File patchContent = new File(tmp, "patch-content-" + i);
} else { is = patchZip.getInputStream(patchXmlEntry); final List<BundledPatch.BundledPatchEntry> patches = PatchBundleXml.parse(is).getPatches(); displayPatchBundleXml(ctx, patches, patchZip);
} else { is = patchZip.getInputStream(patchXmlEntry); final List<BundledPatchEntry> patches = PatchBundleXml.parse(is).getPatches(); displayPatchBundleXml(ctx, patches, patchZip);
} else { is = patchZip.getInputStream(patchXmlEntry); final List<BundledPatch.BundledPatchEntry> patches = PatchBundleXml.parse(is).getPatches(); displayPatchBundleXml(ctx, patches, patchZip);
@Test public void testBasic() throws Exception { try (final InputStream is = getResource("multi-patch-01.xml")) { final BundledPatch bundledPatch = PatchBundleXml.parse(is); Assert.assertNotNull(bundledPatch); Assert.assertFalse(bundledPatch.getPatches().isEmpty()); } }
protected PatchingResult applyPatchBundle(final File workDir, final BundledPatch bundledPatch, final ContentVerificationPolicy contentPolicy) throws PatchingException, IOException { final List<BundledPatchEntry> patches = bundledPatch.getPatches(); if(patches.isEmpty()) { throw new PatchingException(PatchLogger.ROOT_LOGGER.patchBundleIsEmpty());
@Override public void writeContent(XMLExtendedStreamWriter writer, BundledPatch bundledPatch) throws XMLStreamException { writer.writeStartElement(Element.PATCHES.name); writer.writeDefaultNamespace(PatchXml.Namespace.PATCH_BUNDLE_1_0.getNamespace()); for (final BundledPatch.BundledPatchEntry entry : bundledPatch.getPatches()) { writer.writeEmptyElement(Element.PATCH_ELEMENT.name); writer.writeAttribute(Attribute.ID.name, entry.getPatchId()); writer.writeAttribute(Attribute.PATH.name, entry.getPatchPath()); } writer.writeEndElement(); } }
protected PatchingResult applyPatchBundle(final File workDir, final BundledPatch bundledPatch, final ContentVerificationPolicy contentPolicy) throws PatchingException, IOException { final List<BundledPatchEntry> patches = bundledPatch.getPatches(); if(patches.isEmpty()) { throw new PatchingException(PatchLogger.ROOT_LOGGER.patchBundleIsEmpty());
@Override public void writeContent(XMLExtendedStreamWriter writer, BundledPatch bundledPatch) throws XMLStreamException { writer.writeStartElement(Element.PATCHES.name); writer.writeDefaultNamespace(PatchXml.Namespace.PATCH_BUNDLE_1_0.getNamespace()); for (final BundledPatch.BundledPatchEntry entry : bundledPatch.getPatches()) { writer.writeEmptyElement(Element.PATCH_ELEMENT.name); writer.writeAttribute(Attribute.ID.name, entry.getPatchId()); writer.writeAttribute(Attribute.PATH.name, entry.getPatchPath()); } writer.writeEndElement(); } }