@Override public OutputStream append() throws ResourceException { return FileHelper.getOutputStream(_file, true); }
public static OutputStream getOutputStream(File file) throws IllegalStateException { return getOutputStream(file, false); }
@Override public OutputStream append() throws ResourceException { return FileHelper.getOutputStream(_file, true); }
public static OutputStream getOutputStream(File file) throws IllegalStateException { return getOutputStream(file, false); }
@Override public OutputStream write() throws ResourceException { if (_file.isDirectory()) { throw new ResourceException(this, "Cannot write to directory: " + _file); } return FileHelper.getOutputStream(_file); }
public static Writer getWriter(File file, String encoding, boolean append, boolean insertBom) throws IllegalStateException { if (append && insertBom) { throw new IllegalArgumentException("Can not insert BOM into appending writer"); } final OutputStream outputStream = getOutputStream(file, append); return getWriter(outputStream, encoding, insertBom); }
public static Writer getWriter(File file, String encoding, boolean append, boolean insertBom) throws IllegalStateException { if (append && insertBom) { throw new IllegalArgumentException("Can not insert BOM into appending writer"); } final OutputStream outputStream = getOutputStream(file, append); return getWriter(outputStream, encoding, insertBom); }
@Override public OutputStream write() throws ResourceException { if (_file.isDirectory()) { throw new ResourceException(this, "Cannot write to directory: " + _file); } return FileHelper.getOutputStream(_file); }
public static void copy(File from, File to) throws IllegalStateException { assert from.exists(); final InputStream in = getInputStream(from); try { final OutputStream out = getOutputStream(to); try { copy(in, out); } finally { safeClose(out); } } finally { safeClose(in); } }
public static void copy(File from, File to) throws IllegalStateException { assert from.exists(); final InputStream in = getInputStream(from); try { final OutputStream out = getOutputStream(to); try { copy(in, out); } finally { safeClose(out); } } finally { safeClose(in); } }