Package org.apache.curator.utils
Class CloseableUtils
- java.lang.Object
-
- org.apache.curator.utils.CloseableUtils
-
public class CloseableUtils extends java.lang.Object
This class adds back functionality that was removed in Guava v16.0.
-
-
Constructor Summary
Constructors Constructor Description CloseableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeQuietly(java.io.Closeable closeable)
This method has been added because Guava has removed thecloseQuietly()
method fromCloseables
in v16.0.
-
-
-
Method Detail
-
closeQuietly
public static void closeQuietly(java.io.Closeable closeable)
This method has been added because Guava has removed the
closeQuietly()
method fromCloseables
in v16.0. It's tempting simply to replace calls tocloseQuietly(closeable)
with calls toclose(closeable, true)
to closeCloseable
s while swallowingIOException
s, butclose()
is declared asthrows IOException
whereascloseQuietly()
is not, so it's not a drop-in replacement.On the whole, Guava is very backwards compatible. By fixing this nit, Curator can continue to support newer versions of Guava without having to bump its own dependency version.
-
-