Package com.codeborne.selenide.proxy
Class FileDownloadFilter
java.lang.Object
com.codeborne.selenide.proxy.FileDownloadFilter
- All Implemented Interfaces:
com.browserup.bup.filters.RequestFilter
,com.browserup.bup.filters.ResponseFilter
public class FileDownloadFilter
extends Object
implements com.browserup.bup.filters.RequestFilter, com.browserup.bup.filters.ResponseFilter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activate this filter.void
Deactivate this filter.@Nullable 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) void
filterResponse
(io.netty.handler.codec.http.HttpResponse response, com.browserup.bup.util.HttpMessageContents contents, com.browserup.bup.util.HttpMessageInfo messageInfo) void
reset()
-
Constructor Details
-
FileDownloadFilter
-
-
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 @Nullable 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 interfacecom.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 interfacecom.browserup.bup.filters.ResponseFilter
-
downloads
- Returns:
- list of all downloaded files since activation.
-
responsesAsString
- Returns:
- all intercepted http response (as a string) - it can be useful for debugging
-