001 002package io.vrap.rmf.base.client.utils; 003 004import java.io.IOException; 005 006public class FileUtils { 007 public static <T> T executing(final SupplierThrowingIOException<T> supplier) { 008 try { 009 return supplier.get(); 010 } 011 catch (final IOException e) { 012 throw new FileException(e); 013 } 014 } 015 016 @FunctionalInterface 017 public interface SupplierThrowingIOException<T> { 018 T get() throws IOException; 019 } 020}