Class FileDownloadFilter

java.lang.Object
com.codeborne.selenide.proxy.FileDownloadFilter
All Implemented Interfaces:
com.browserup.bup.filters.RequestFilter, com.browserup.bup.filters.ResponseFilter

@ParametersAreNonnullByDefault public class FileDownloadFilter extends Object implements com.browserup.bup.filters.RequestFilter, com.browserup.bup.filters.ResponseFilter
  • Constructor Details

    • FileDownloadFilter

      public FileDownloadFilter(Config config)
  • Method Details

    • activate

      public void activate()
      Activate this filter. Starting from this moment, it will record all responses that seem to be a "file download".
    • reset

      public void reset()
    • deactivate

      public void deactivate()
      Deactivate this filter. Starting from this moment, it will not record any responses.
    • filterRequest

      public io.netty.handler.codec.http.HttpResponse filterRequest(io.netty.handler.codec.http.HttpRequest request, com.browserup.bup.util.HttpMessageContents contents, com.browserup.bup.util.HttpMessageInfo messageInfo)
      Specified by:
      filterRequest in interface com.browserup.bup.filters.RequestFilter
    • filterResponse

      public void filterResponse(io.netty.handler.codec.http.HttpResponse response, com.browserup.bup.util.HttpMessageContents contents, com.browserup.bup.util.HttpMessageInfo messageInfo)
      Specified by:
      filterResponse in interface com.browserup.bup.filters.ResponseFilter
    • downloads

      @CheckReturnValue @Nonnull public Downloads downloads()
      Returns:
      list of all downloaded files since activation.
    • responsesAsString

      @CheckReturnValue @Nonnull public String responsesAsString()
      Returns:
      all intercepted http response (as a string) - it can be useful for debugging