Class FileDownloadFilter

  • All Implemented Interfaces:
    net.lightbody.bmp.filters.ResponseFilter

    public class FileDownloadFilter
    extends java.lang.Object
    implements net.lightbody.bmp.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.
      void filterResponse​(io.netty.handler.codec.http.HttpResponse response, net.lightbody.bmp.util.HttpMessageContents contents, net.lightbody.bmp.util.HttpMessageInfo messageInfo)  
      java.util.List<java.io.File> getDownloadedFiles()  
      java.lang.String getResponses()  
      • 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 contain header "Content-Disposition". These responses are supposed to contain a file being downloaded.
      • 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,
                                   net.lightbody.bmp.util.HttpMessageContents contents,
                                   net.lightbody.bmp.util.HttpMessageInfo messageInfo)
        Specified by:
        filterResponse in interface net.lightbody.bmp.filters.ResponseFilter
      • getDownloadedFiles

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

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