Class UrlPacScriptSource
java.lang.Object
com.github.markusbernhardt.proxy.selector.pac.UrlPacScriptSource
- All Implemented Interfaces:
PacScriptSource
Script source that will load the content of a PAC file from an webserver. The
script content is cached once it was downloaded.
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetScriptContentprotected intgetTimeOut(String overrideProperty, int defaultValue) Gets the timeout value from a property or uses the given default value if the property cannot be parsed.booleanisScriptValidtoString()
-
Field Details
-
OVERRIDE_CONNECT_TIMEOUT
- See Also:
-
OVERRIDE_READ_TIMEOUT
- See Also:
-
-
Constructor Details
-
UrlPacScriptSource
Constructor- Parameters:
url- the URL to download the script from.
-
-
Method Details
-
getScriptContent
getScriptContent- Specified by:
getScriptContentin interfacePacScriptSource- Returns:
- a script.
- Throws:
IOException- on read error.- See Also:
-
getTimeOut
Gets the timeout value from a property or uses the given default value if the property cannot be parsed.- Parameters:
overrideProperty- the property to define the timeout value in millisecondsdefaultValue- the default timeout value in milliseconds.- Returns:
- the value to use.
-
toString
-
isScriptValid
public boolean isScriptValid()isScriptValid- Specified by:
isScriptValidin interfacePacScriptSource- Returns:
- true if everything is fine, else false.
- See Also:
-