Interface ResourceFetcher

  • All Known Implementing Classes:
    FileResourceFetcher, HttpResourceFetcher

    public interface ResourceFetcher

    Interface for asynchronously fetching simple remote resources, for instance via HTTP or local file-system.

    Any exceptions are returned via exceptionHandler(Handler), which the user should set if they are interested in handling errors.

    Author:
    Marc Savy <marc@rhymewithgravy.com>
    • Method Detail

      • fetch

        void fetch​(io.vertx.core.Handler<io.vertx.core.buffer.Buffer> resultHandler)
        Fetch a resource and return its content via the resultHandler
        Parameters:
        resultHandler - the result handler
      • exceptionHandler

        ResourceFetcher exceptionHandler​(io.vertx.core.Handler<Throwable> exceptionHandler)
        Set an exception handler, invoked in an error occurs.
        Parameters:
        exceptionHandler - the exception handler
        Returns:
        fluent