Class FileDownloadFilter

  • All Implemented Interfaces:
    com.browserup.bup.filters.ResponseFilter

    @ParametersAreNonnullByDefault
    public class FileDownloadFilter
    extends java.lang.Object
    implements com.browserup.bup.filters.ResponseFilter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate()
      Activate this filter.
      void deactivate()
      Deactivate this filter.
      Downloads downloads()  
      void filterResponse​(io.netty.handler.codec.http.HttpResponse response, com.browserup.bup.util.HttpMessageContents contents, com.browserup.bup.util.HttpMessageInfo messageInfo)  
      void reset()  
      java.lang.String responsesAsString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileDownloadFilter

        public FileDownloadFilter​(Config config)
    • Method Detail

      • 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.
      • 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 java.lang.String responsesAsString()
        Returns:
        all intercepted http response (as a string) - it can be useful for debugging