public static long copy(final Path source, final OutputStream out) throws IOException, SecurityException { checkNotNull("source", source); checkNotNull("out", out); final InputStream in = newInputStream(source); try { return internalCopy(in, out); } finally { try { in.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
public static long copy(final Path source, final OutputStream out) throws IOException, SecurityException { checkNotNull("source", source); checkNotNull("out", out); final InputStream in = newInputStream(source); try { return internalCopy(in, out); } finally { try { in.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
public static long copy(final Path source, final OutputStream out) throws IOException, SecurityException { checkNotNull("source", source); checkNotNull("out", out); final InputStream in = newInputStream(source); try { return internalCopy(in, out); } finally { try { in.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
public static long copy(final InputStream in, final Path target, final CopyOption... options) throws IOException, FileAlreadyExistsException, DirectoryNotEmptyException, UnsupportedOperationException, SecurityException { checkNotNull("in", in); checkNotNull("target", target); checkNotNull("options", options); boolean replaceExisting = false; for (final CopyOption opt : options) { if (opt == StandardCopyOption.REPLACE_EXISTING) { replaceExisting = true; break; } else { checkNotNull("opt", opt); throw new UnsupportedOperationException(opt + " not supported"); } } if (replaceExisting) { deleteIfExists(target); } final OutputStream out = newOutputStream(target, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); try { return internalCopy(in, out); } finally { try { out.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
return internalCopy(in, out); } finally {
return internalCopy(in, out); } finally {