final ZipEntry bundledZip = patchZip.getEntry(bundledPatch.getPatchPath()); if (bundledZip == null) { throw new CommandException("Patch file not found in the bundle: " + bundledPatch.getPatchPath()); throw new CommandLineException("Failed to locate " + PatchXml.PATCH_XML + " in bundled patch " + bundledPatch.getPatchPath()); ctx.printLine("CONTENT OF " + bundledPatch.getPatchPath() + ':' + Util.LINE_SEPARATOR); ctx.printLine(""); } catch (Exception e) { throw new CommandException("Failed to inspect " + bundledPatch.getPatchPath(), e); } finally { IoUtils.safeClose(bundledPatchIs);
final ZipEntry bundledZip = patchZip.getEntry(bundledPatch.getPatchPath()); if (bundledZip == null) { throw new CommandException("Patch file not found in the bundle: " + bundledPatch.getPatchPath()); throw new CommandLineException("Failed to locate " + PatchXml.PATCH_XML + " in bundled patch " + bundledPatch.getPatchPath()); ctx.printLine("CONTENT OF " + bundledPatch.getPatchPath() + ':' + Util.LINE_SEPARATOR); ctx.printLine(""); } catch (Exception e) { throw new CommandException("Failed to inspect " + bundledPatch.getPatchPath(), e); } finally { IoUtils.safeClose(bundledPatchIs);
final ZipEntry bundledZip = patchZip.getEntry(bundledPatch.getPatchPath()); if(bundledZip == null) { throw new CommandLineException("Patch file not found in the bundle: " + bundledPatch.getPatchPath()); throw new CommandLineException("Failed to locate " + PatchXml.PATCH_XML + " in bundled patch " + bundledPatch.getPatchPath()); ctx.printLine("CONTENT OF " + bundledPatch.getPatchPath() + ':' + Util.LINE_SEPARATOR); ctx.printLine(""); } catch (Exception e) { throw new CommandLineException("Failed to inspect " + bundledPatch.getPatchPath(), e); } finally { IoUtils.safeClose(bundledPatchIs);
final File patch = new File(workDir, entry.getPatchPath()); final FileInputStream is = new FileInputStream(patch); PatchingResult currentResult = null;
final File patch = new File(workDir, entry.getPatchPath()); final FileInputStream is = new FileInputStream(patch); PatchingResult currentResult = null;
final ZipEntry bundledZip = patchZip.getEntry(bundledPatch.getPatchPath()); if(bundledZip == null) { throw new CommandLineException("Patch file not found in the bundle: " + bundledPatch.getPatchPath()); throw new CommandLineException("Failed to locate " + PatchXml.PATCH_XML + " in bundled patch " + bundledPatch.getPatchPath()); ctx.printLine("CONTENT OF " + bundledPatch.getPatchPath() + ':' + Util.LINE_SEPARATOR); ctx.printLine(""); } catch (Exception e) { throw new CommandLineException("Failed to inspect " + bundledPatch.getPatchPath(), e); } finally { IoUtils.safeClose(bundledPatchIs);
@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(); } }
@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(); } }