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:com.bt.download.android.gui.httpserver.DownloadHandler.java

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

From source file:sorcer.installer.Installer.java

protected void close(Closeable inputStream) {
    if (inputStream != null) {
        try {// w w w . ja  va  2  s.c  om
            inputStream.close();
        } catch (IOException e) {
            // ignore
        }
    }
}

From source file:streaming.common.HdfsClassLoader.java

/**
 * Close the {@link Closeable} without any exceptions
 *//*from   w ww.jav  a 2  s. c o  m*/
private void closeQuietly(Closeable closeable) {
    if (closeable != null) {
        try {
            closeable.close();
        } catch (IOException ioe) {
            // the point of being quiet is to not propogate this
        }
    }
}

From source file:net.shibboleth.idp.cas.authn.PkixProxyAuthenticator.java

private void close(Closeable resource) {
    if (resource != null) {
        try {/*w ww.j  av a 2 s.c o m*/
            resource.close();
        } catch (IOException e) {
            log.warn("Error closing " + resource, e);
        }
    }
}

From source file:com.android.loganalysis.LogAnalyzer.java

/**
 * Helper to close a {@link Closeable}.//from w  w  w.j  a v a2 s .c om
 */
private void close(Closeable closeable) {
    if (closeable != null) {
        try {
            closeable.close();
        } catch (IOException e) {
            // Ignore
        }
    }
}

From source file:com.mobeelizer.java.sync.MobeelizerOutputData.java

private void closeQuietly(final Closeable closeable) {
    if (closeable == null) {
        return;//from ww  w.  j a v  a 2s.  c om
    }
    try {
        closeable.close();
    } catch (IOException e) {
        // TODO Log.d(TAG, e.getMessage(), e);
    }
}

From source file:net.wasdev.maven.plugins.swaggerdocgen.SwaggerProcessor.java

private void tryToClose(Closeable c) {
    if (c != null) {
        try {//from   www.j a v  a  2  s . co m
            c.close();
        } catch (IOException ioe) {
            logger.severe("Failed to successfully close the file.");
        }
    }
}

From source file:edu.umn.msi.tropix.common.io.IOUtilsImpl.java

public void closeQuietly(@Nullable final Closeable closeable) {
    try {/*from ww w .  j a  v a 2s .c  o m*/
        if (closeable != null) {
            closeable.close();
        }
    } catch (final Exception e) {
        // Ignore IOException and NullPointerException
        return;
    }
}

From source file:main.server.DemoPageProvider.java

private void close(Closeable o) {
    if (o != null) {
        try {/*from   ww  w  . j a  va 2  s  .  co m*/
            o.close();
        } catch (IOException e) {
            // ignore
        }
    }
}

From source file:com.github.woonsan.katharsis.invoker.KatharsisInvoker.java

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