/** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device stream, can be null. */ public static void close(InputStream device) { close((AutoCloseable) device); }
/** * Close a Reader without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device Reader, can be null. */ public static void close(Reader device) { close((AutoCloseable) device); }
/** * Close a Channel without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device channel, can be null. * @since Ant 1.8.0 */ public static void close(Channel device) { close((AutoCloseable) device); }
void complete() { FileUtils.close(ps); } }
private void closeCurrent() { FileUtils.close(currentStream); currentStream = null; } }
private void closeCurrent() { FileUtils.close(currentStream); currentStream = null; } }
/** * Close a Writer without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * @param device output writer, can be null. */ public static void close(Writer device) { close((AutoCloseable) device); }
/** * Close a stream without throwing any exception if something went wrong. * Do not attempt to close it if the argument is null. * * @param device stream, can be null. */ public static void close(OutputStream device) { close((AutoCloseable) device); }
/** * Constructor used by Ant's introspection mechanism. * The original filter reader is only used for chaining * purposes, never for filtering purposes (and indeed * it would be useless for filtering purposes, as it has * no real data to filter). ChainedReaderHelper uses * this placeholder instance to create a chain of real filters. */ public BaseFilterReader() { super(new StringReader("")); FileUtils.close(this); }
/** * Resets the buffer for the current thread. */ private void resetBufferInfo() { Thread current = Thread.currentThread(); BufferInfo bufferInfo = buffers.get(current); FileUtils.close(bufferInfo.buffer); bufferInfo.buffer = new ByteArrayOutputStream(); bufferInfo.crSeen = false; }
public void close() throws IOException { FileUtils.close(in); z.close(); } protected void finalize() throws Throwable {
/** * Set the <code>OutputStream</code> by means of which * input can be sent to the process. * @param os the <code>OutputStream</code>. */ public void setProcessInputStream(OutputStream os) { if (input != null) { inputThread = createPump(input, os, true, nonBlockingRead); } else { FileUtils.close(os); } }
/** * Cleans up any resources held by this classloader. Any open archive * files are closed. */ public synchronized void cleanup() { for (final JarFile jarFile : jarFiles.values()) { FileUtils.close(jarFile); } jarFiles = new Hashtable<>(); if (project != null) { project.removeBuildListener(this); } project = null; }
@Override public void close() throws IOException { FileUtils.close(in); classLoader.cleanup(); }