Package org.htmlunit
Class NiceRefreshHandler
java.lang.Object
org.htmlunit.ImmediateRefreshHandler
org.htmlunit.NiceRefreshHandler
- All Implemented Interfaces:
Serializable
,RefreshHandler
This refresh handler performs an immediate refresh if the refresh delay is
less or equal to the configured time and otherwise ignores totally the refresh instruction.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNiceRefreshHandler
(int maxDelay) Creates a new refresh handler that will immediately refresh if the refresh delay is no longer thanmaxDelay
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleRefresh
(Page page, URL url, int requestedWait) Refreshes the specified page using the specified URL immediately if therequestedWait
is not larger than themaxDelay
.
-
Constructor Details
-
NiceRefreshHandler
public NiceRefreshHandler(int maxDelay) Creates a new refresh handler that will immediately refresh if the refresh delay is no longer thanmaxDelay
. No refresh will be perform at all for refresh values larger thanmaxDelay
.- Parameters:
maxDelay
- the maximum refreshValue (in seconds) that should cause a refresh
-
-
Method Details
-
handleRefresh
Refreshes the specified page using the specified URL immediately if therequestedWait
is not larger than themaxDelay
. Does nothing otherwise.- Specified by:
handleRefresh
in interfaceRefreshHandler
- Overrides:
handleRefresh
in classImmediateRefreshHandler
- Parameters:
page
- the page that is going to be refreshedurl
- the URL where the new page will be loadedrequestedWait
- the number of seconds to wait before reloading the page- Throws:
IOException
- if the refresh fails
-