Package com.codeborne.selenide.proxy
Class FileDownloadFilter
- java.lang.Object
-
- com.codeborne.selenide.proxy.FileDownloadFilter
-
- All Implemented Interfaces:
net.lightbody.bmp.filters.ResponseFilter
public class FileDownloadFilter extends java.lang.Object implements net.lightbody.bmp.filters.ResponseFilter
-
-
Constructor Summary
Constructors Constructor Description FileDownloadFilter(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activate this filter.voiddeactivate()Deactivate this filter.voidfilterResponse(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.StringgetResponses()
-
-
-
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:
filterResponsein interfacenet.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
-
-