Class FileDownloadFilter

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

    public class FileDownloadFilter
    extends java.lang.Object
    implements com.browserup.bup.filters.ResponseFilter
    • 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
      • getDownloadedFiles

        public java.util.List<DownloadedFile> getDownloadedFiles()
        Returns:
        list of all downloaded files since activation.
      • getDownloadedFiles

        public java.util.List<DownloadedFile> getDownloadedFiles​(FileFilter fileFilter)
        Returns:
        list of downloaded files matching given criteria
      • responsesAsString

        public java.lang.String responsesAsString()
        Returns:
        all intercepted http response (as a string) - it can be useful for debugging
      • downloadedFilesAsString

        public java.lang.String downloadedFilesAsString()
        Returns:
        all downloaded files (as a string) - it can be useful for debugging