org.apache.curator.utils
Class CloseableUtils

java.lang.Object
  extended by org.apache.curator.utils.CloseableUtils

public class CloseableUtils
extends Object

This class adds back functionality that was removed in Guava v16.0.


Constructor Summary
CloseableUtils()
           
 
Method Summary
static void closeQuietly(Closeable closeable)
           This method has been added because Guava has removed the closeQuietly() method from Closeables in v16.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseableUtils

public CloseableUtils()
Method Detail

closeQuietly

public static void closeQuietly(Closeable closeable)

This method has been added because Guava has removed the closeQuietly() method from Closeables in v16.0. It's tempting simply to replace calls to closeQuietly(closeable) with calls to close(closeable, true) to close Closeables while swallowing IOExceptions, but close() is declared as throws IOException whereas closeQuietly() 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.

See https://issues.apache.org/jira/browse/CURATOR-85



Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.