|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.uadetector.internal.util.Closeables
public final class Closeables
This class is intended to provide utility methods to close Closeable
instances.
Method Summary | |
---|---|
static void |
close(java.io.Closeable closeable,
boolean swallowIOException)
Closes a Closeable and swallows an occurring IOException if argument swallowIOException
is true , otherwise the IOException will be thrown. |
static void |
closeAndConvert(java.io.Closeable closeable,
boolean swallowIOException)
Closes a Closeable and swallows an occurring IOException if argument swallowIOException
is true , otherwise the IOException will be converted into a runtime exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void close(@Nullable java.io.Closeable closeable, boolean swallowIOException) throws java.io.IOException
Closeable
and swallows an occurring IOException
if argument swallowIOException
is true
, otherwise the IOException
will be thrown.
This method does nothing if a null reference is passed as closeable
.
closeable
- the Closeable
object to be closed, or null
swallowIOException
- true
if an occurring IOException
should be swallowed and logged or false
to
throw it
java.io.IOException
- if the given closeable
cannot be closedpublic static void closeAndConvert(@Nullable java.io.Closeable closeable, boolean swallowIOException)
Closeable
and swallows an occurring IOException
if argument swallowIOException
is true
, otherwise the IOException
will be converted into a runtime exception.
This method does nothing if a null reference is passed as closeable
.
closeable
- the Closeable
object to be closed, or null
swallowIOException
- true
if an occurring IOException
should be swallowed and logged or false
to
throw a CannotCloseException
CannotCloseException
- if the given closeable
cannot be closed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |