public static void copy(File src, OutputStream out) throws IOException { FileInputStream in = new FileInputStream(src); try { copy(in,out); } finally { closeQuietly(in); } }
public static void copy(InputStream in, File out) throws IOException { FileOutputStream fos = new FileOutputStream(out); try { copy(in,fos); } finally { closeQuietly(fos); } }
public static void copy(File src, OutputStream out) throws IOException { FileInputStream in = new FileInputStream(src); try { copy(in, out); } finally { closeQuietly(in); } }
public static void copy(File src, OutputStream out) throws IOException { FileInputStream in = new FileInputStream(src); try { copy(in,out); } finally { closeQuietly(in); } }
public Void invoke(File f, VirtualChannel channel) throws IOException { f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); Writer w; if (encoding != null) { w = new OutputStreamWriter(fos, encoding); } else { w = new OutputStreamWriter(fos); } try { w.write(content); } finally { IOUtils.closeQuietly(w); } return null; } });
public static void copy(InputStream in, File out) throws IOException { FileOutputStream fos = new FileOutputStream(out); try { copy(in, fos); } finally { closeQuietly(fos); } }
public static void copy(InputStream in, File out) throws IOException { FileOutputStream fos = new FileOutputStream(out); try { copy(in,fos); } finally { closeQuietly(fos); } }
public static void copy(File src, OutputStream out) throws IOException { FileInputStream in = new FileInputStream(src); try { copy(in,out); } finally { closeQuietly(in); } }
public static void copy(InputStream in, File out) throws IOException { FileOutputStream fos = new FileOutputStream(out); try { copy(in,fos); } finally { closeQuietly(fos); } }
protected final boolean createEmptyChangeLog(File changelogFile, BuildListener listener, String rootTag) { FileWriter w = null; try { w = new FileWriter(changelogFile); w.write("<" + rootTag + "/>"); w.close(); return true; } catch (IOException e) { e.printStackTrace(listener.error(e.getMessage())); return false; } finally { IOUtils.closeQuietly(w); } }
public Void call() throws IOException { FileInputStream fis=null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis,p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } });
public Void call() throws IOException { FileInputStream fis=null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis,p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } });
public Void call() throws IOException { FileInputStream fis = null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis, p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } });
public Void call() throws IOException { FileInputStream fis=null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis,p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } });
private int readSmbFile(SmbFile f) throws IOException { InputStream in=null; try { in = f.getInputStream(); return Integer.parseInt(IOUtils.toString(in)); } finally { IOUtils.closeQuietly(in); } }
private int readSmbFile(SmbFile f) throws IOException { InputStream in=null; try { in = f.getInputStream(); return Integer.parseInt(IOUtils.toString(in)); } finally { IOUtils.closeQuietly(in); } }
/** * {@inheritDoc} */ @NonNull @Override public byte[] getKeyStoreBytes() { try { InputStream inputStream = new FileInputStream(new File(keyStoreFile)); try { return IOUtils.toByteArray(inputStream); } finally { IOUtils.closeQuietly(inputStream); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not read private key file " + keyStoreFile, e); return new byte[0]; } }
/** * Overwrites the file by the given string. */ public void write(String text) throws IOException { file.getParentFile().mkdirs(); AtomicFileWriter w = new AtomicFileWriter(file); try { w.write(text); w.commit(); } finally { w.abort(); IOUtils.closeQuietly(w); } }
public Integer invoke(File f, VirtualChannel channel) throws IOException { Archiver a = factory.create(out); try { scanner.scan(f, a); } finally { IOUtils.closeQuietly(a); } return a.countEntries(); } private static final long serialVersionUID = 1L;
/** * Sends out the raw polling log output. */ public void doPollingLog(StaplerRequest req, StaplerResponse rsp) throws IOException { rsp.setContentType("text/plain;charset=UTF-8"); // Prevent jelly from flushing stream so Content-Length header can be added afterwards FlushProofOutputStream out = null; try { out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req)); getPollingLogText().writeLogTo(0, out); } finally { IOUtils.closeQuietly(out); } }