@Override public default O apply(I arg) { try { return applyUnchecked(arg); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException(e); } }
@Override public default O apply(I arg) { try { return applyUnchecked(arg); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException(e); } }
@Override public final <E> E read(UncheckedFunc<InputStream, E> readCallback) { final InputStream in = read(); try { final E result = readCallback.applyUnchecked(in); return result; } catch (Exception e) { throw new ResourceException(this, "Error occurred in read callback", e); } finally { FileHelper.safeClose(in); } }
@Override public final <E> E read(UncheckedFunc<InputStream, E> readCallback) { final InputStream in = read(); try { final E result = readCallback.applyUnchecked(in); return result; } catch (Exception e) { throw new ResourceException(this, "Error occurred in read callback", e); } finally { FileHelper.safeClose(in); } }