public PlexusIoResource resolve(final PlexusIoResource resource) throws IOException { final Deferred deferred = new Deferred( resource, this, streamTransformers != AbstractPlexusIoResourceCollection.identityTransformer); return deferred.asResource(); }
@Override public Promise<V> fin(ThrowableRunnable runnable) { Deferred<V> deferred = getFactory().defer(); addStateListener( (promise, state) -> { if (state.isDone()) { try { runnable.run(); if (promise.isSuccess()) { deferred.success(promise.getValue()); } else { deferred.failure(promise.cause()); } } catch (Throwable e) { deferred.failure(e); } } }); return deferred.promise(); }