/** * Writes the raw XML to the given {@link Writer}. * Writer will not be closed by the implementation. */ public void writeRawTo(Writer w) throws IOException { try (Reader r = readRaw()) { IOUtils.copy(r, w); } }
/** * Writes the raw XML to the given {@link Writer}. * Writer will not be closed by the implementation. */ public void writeRawTo(Writer w) throws IOException { try (Reader r = readRaw()) { IOUtils.copy(r, w); } }
/** * Writes the raw XML to the given {@link Writer}. * Writer will not be closed by the implementation. * @deprecated Safer to use {@link #writeRawTo(OutputStream)}. */ @Deprecated public void writeRawTo(Writer w) throws IOException { Reader r = readRaw(); try { Util.copyStream(r,w); } finally { r.close(); } }
/** * Writes the raw XML to the given {@link Writer}. * Writer will not be closed by the implementation. * @deprecated Safer to use {@link #writeRawTo(OutputStream)}. */ @Deprecated public void writeRawTo(Writer w) throws IOException { Reader r = readRaw(); try { Util.copyStream(r,w); } finally { r.close(); } }
/** * Writes the raw XML to the given {@link Writer}. * Writer will not be closed by the implementation. * @deprecated Safer to use {@link #writeRawTo(OutputStream)}. */ @Deprecated public void writeRawTo(Writer w) throws IOException { Reader r = readRaw(); try { Util.copyStream(r,w); } finally { r.close(); } }
/** * Writes the raw XML to the given {@link Writer}. Writer will not be closed * by the implementation. * * @deprecated Safer to use {@link #writeRawTo(OutputStream)}. */ @Deprecated public void writeRawTo(Writer w) throws IOException { Reader r = readRaw(); try { Util.copyStream(r, w); } finally { r.close(); } }
/** * If copied, also copy the {@link #template}. * <br> * {@inheritDoc} */ @Override public void onCopiedFrom(Item src) { super.onCopiedFrom(src); //noinspection unchecked TemplateDrivenMultiBranchProject<P, B> projectSrc = (TemplateDrivenMultiBranchProject<P, B>) src; /* * onLoad should have been invoked already, so there should be an * empty template. Just update by XML and that's it. */ try { template.updateByXml((Source) new StreamSource(projectSrc.getTemplate().getConfigFile().readRaw())); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to copy template from " + src.getName() + " into " + getName(), e); } }
updateByXml(project, new StreamSource(owner.getTemplate().getConfigFile().readRaw()));