Example usage for java.io Closeable close

List of usage examples for java.io Closeable close

Introduction

In this page you can find the example usage for java.io Closeable close.

Prototype

public void close() throws IOException;

Source Link

Document

Closes this stream and releases any system resources associated with it.

Usage

From source file:org.jenkinsci.plugins.publishoveronedrive.domain.JsonObjectRequest.java

private void closeQuietly(Closeable closeable) {
    if (closeable != null) {
        try {// w w  w.  j a  v  a  2s  . c o  m
            closeable.close();
        } catch (IOException e) {
            //Ignored
        }
    }
}

From source file:ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor.java

@Override
public boolean handleException(RequestDetails theRequestDetails, BaseServerResponseException theException,
        HttpServletRequest theRequest, HttpServletResponse theResponse) throws ServletException, IOException {
    Closeable writer = (Closeable) handleException(theRequestDetails, theException);
    writer.close();
    return false;
}

From source file:com.frostwire.gui.library.DownloadTask.java

private void close(Closeable closable) {
    if (closable != null) {
        try {/*from ww  w.  ja v a  2  s  . c o  m*/
            closable.close();
        } catch (Throwable e) {
        }
    }
}

From source file:com.nebhale.cyclinglibrary.web.GzipFilterTest.java

private void closeQuietly(Closeable... closeables) {
    for (Closeable closeable : closeables) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e) {
            }/*  ww w  .j a  v a  2 s . c o  m*/
        }
    }
}

From source file:org.apache.hive.hcatalog.templeton.tool.HDFSStorage.java

private void close(Closeable is) {
    if (is == null) {
        return;//w  w  w. j a  v  a 2  s .  co  m
    }
    try {
        is.close();
    } catch (IOException ex) {
        LOG.trace("Failed to close InputStream: " + ex.getMessage());
    }
}

From source file:org.apache.empire.xml.XMLConfiguration.java

private void close(final Closeable closeable) {
    if (closeable != null) {
        try {/*from w ww .  j ava  2s  . c o m*/
            closeable.close();
        } catch (IOException e) {
            log.debug(e.getMessage());
        }
    }
}

From source file:org.topazproject.otm.AbstractBlob.java

/**
 * Closes all the streams 'silently'. Catches and logs exceptions instead of throwing.
 *
 * @param streams array of streams//ww  w.  ja v a  2  s .  co m
 */
protected void closeAll(Closeable... streams) {
    for (Closeable c : streams) {
        try {
            if (c != null)
                c.close();
        } catch (IOException e) {
            log.warn("Failed to close stream for " + getId(), e);
        }
    }
}

From source file:org.smartfrog.services.www.bulkio.client.AbstractBulkIOClient.java

/**
 * Close quietly, log on an exception, do nothing on null
 *
 * @param c thing to close/*from  w w  w. ja  va2s  . co  m*/
 */
protected void closeQuietly(Closeable c) {
    if (c != null) {
        try {
            c.close();
        } catch (IOException e) {
            log.warn(e);
        }
    }
}

From source file:io.pravega.common.cluster.zkImpl.ClusterZKImpl.java

private void close(Closeable c) {
    if (c == null) {
        return;/*from ww  w .  j  a v  a2s.  co m*/
    }
    try {
        c.close();
    } catch (IOException e) {
        log.error("Error while closing resource", e);
    }
}

From source file:org.rhq.modules.plugins.jbossas7.ASUploadConnection.java

private void closeQuietly(final Closeable closeable) {
    if (closeable != null) {
        try {/*from  ww w  .  ja v  a  2 s .  co  m*/
            closeable.close();
        } catch (final IOException e) {
        }
    }
}