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:Main.java

public static void close(Closeable closable) {
    if (closable != null) {
        try {/*  w  w w  .  j  a va 2  s  .  com*/
            closable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

public static void close(Closeable closeable) {
    if (closeable == null)
        return;//w w  w . j  a  va  2  s.  c o m
    try {
        closeable.close();
    } catch (IOException e) {
    }
}

From source file:org.lilyproject.util.io.IOUtils.java

public static void closeQuietly(Closeable cl, String identification) {
    if (cl != null) {
        try {/*from   w w  w.  j a  v  a 2s .  co m*/
            cl.close();
        } catch (Throwable t) {
            LogFactory.getLog(IOUtils.class)
                    .error("Problem closing a source or destination on " + identification, t);
        }
    }
}

From source file:Main.java

public static final void closeQuietly(@Nullable Closeable closeable) {
    if (closeable == null) {
        return;//from w ww .j  a  v  a2s.  c o m
    }

    try {
        closeable.close();
    } catch (IOException e) {
        // ignore
    }
}

From source file:Main.java

public static void CloseableClose(Closeable closeable) {
    if (closeable != null) {
        try {/*from   w w w  .  j  a v a2  s .  co  m*/
            closeable.close();
        } catch (IOException e) {
        }
    }
}

From source file:Main.java

public static void close(final Closeable... closeables) {
    for (Closeable closeable : closeables) {
        try {//from   w  w  w.  j  a v a  2  s.  c om
            if (closeable != null) {
                closeable.close();
            }
        } catch (IOException ioe) {
        }
    }
}

From source file:Main.java

/**
 * Closes the given Closeable./*w ww . j a  v a 2s .c  o  m*/
 * 
 * @param closeable
 *            The Closeable to close
 */
public static void close(Closeable closeable) {
    if (closeable != null) {
        try {
            closeable.close();
        } catch (IOException ioe1) {
            /* ignore. */
        }
    }
}

From source file:com.liferay.mobile.android.http.file.FileTransferUtil.java

public static void close(Closeable closeable) {
    if (closeable != null) {
        try {//from   w  w  w .j  a va2s. c  om
            closeable.close();
        } catch (IOException ioe) {
        }
    }
}

From source file:com.synopsys.integration.util.ResourceUtil.java

public static void closeQuietly(final Closeable closeable) {
    try {// w  ww .ja  va 2 s .  c  o m
        if (closeable != null) {
            closeable.close();
        }
    } catch (final IOException e) {
        // ignore
    }
}

From source file:com.comichentai.serialize.SerializeUtil.java

private static void closeQuietly(Closeable c) {
    if (c == null)
        return;/*  www  . j a  v a  2 s. co  m*/
    try {
        c.close();
    } catch (IOException e) {
    }
}