package com.ardverk.utils;

import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;

import org.slf4j.Logger;

import com.ardverk.logging.LoggerUtils;

public class IoUtils {

    private static final Logger LOG 
        = LoggerUtils.getLogger(IoUtils.class);
    
    private IoUtils() {}
    
    public static boolean close(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
                return true;
            } catch (IOException err) {
                LOG.error("IOException", err);
            }
        }
        return false;
    }
    
    public static boolean closeAll(Closeable... closeables) {
        boolean success = false;
        if (closeables != null) {
            for (Closeable c : closeables) {
                success |= close(c);
            }
        }
        return success;
    }
    
    public static boolean closeAll(Iterable<? extends Closeable> closeables) {
        boolean success = false;
        if (closeables != null) {
            for (Closeable c : closeables) {
                success |= close(c);
            }
        }
        return success;
    }
    
    public static boolean flush(Flushable flushable) {
        if (flushable != null) {
            try {
                flushable.flush();
                return true;
            } catch (IOException err) {
                LOG.error("IOException", err);
            }
        }
        return false;
    }
    
    public static boolean flushAll(Flushable... flushables) {
        boolean success = false;
        if (flushables != null) {
            for (Flushable c : flushables) {
                success |= flush(c);
            }
        }
        return success;
    }
    
    public static boolean flushAll(Iterable<? extends Flushable> flushables) {
        boolean success = false;
        if (flushables != null) {
            for (Flushable c : flushables) {
                success |= flush(c);
            }
        }
        return success;
    }
}

@@ -117,172 +117,109 @@
 org.
-slf4j.Logger;%0A%0Aimport com.ardverk.logging.LoggerUtils;%0A%0Apublic class IoUtils %7B%0A%0A    private static final Logger LOG %0A        = LoggerUtils.getLogger(IoUtils.class);
+ardverk.utils.ExceptionUtils;%0A%0A/**%0A * An utility class for I/O operations.%0A */%0Apublic class IoUtils %7B
 %0A   
@@ -476,38 +476,40 @@
         
-LOG.error(%22IOE
+ExceptionUtils.e
 xception
 %22, err);
@@ -492,35 +492,39 @@
 nUtils.exception
-%22, 
+Caught(
 err);%0A          
@@ -1357,30 +1357,32 @@
     
-LOG.error(%22IOE
+ExceptionUtils.e
 xception
 %22, e
@@ -1381,11 +1381,15 @@
 tion
-%22, 
+Caught(
 err)

Use ExceptionUtils