TrueUpdate Core 0.4

net.java.trueupdate.core.io
Class Closeables

java.lang.Object
  extended by net.java.trueupdate.core.io.Closeables

public final class Closeables
extends Object

Provides functions for Closeables.

Author:
Christian Schlichtherle

Method Summary
static
<V,R extends Closeable,X extends Exception>
V
execute(Task<V,R,X> task, R resource)
          Executes the given task on the given resource and finally closes it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static <V,R extends Closeable,X extends Exception> V execute(Task<V,R,X> task,
                                                                    @WillClose
                                                                    R resource)
                 throws X extends Exception,
                        IOException
Executes the given task on the given resource and finally closes it. If both Task.execute(R) and Closeable.close() throw an exception, then only the exception thrown by the task prevails.

Throws:
X extends Exception
IOException

TrueUpdate Core 0.4

Copyright © 2013 Schlichtherle IT Services. All rights reserved.