Class RhinoBasedPacEvaluator
java.lang.Object
net.sourceforge.jnlp.proxy.pac.RhinoBasedPacEvaluator
- All Implemented Interfaces:
PacEvaluator
Represents a Proxy Auto Config file. This object can be used to evaluate the
proxy file to find the proxy for a given url.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classHelper classs to run remote javascript code (specified by the user as PAC URL) inside a sandbox. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRhinoBasedPacEvaluator(URL pacUrl) Initialize a new object by using the PAC file located at the given URL. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToCache(URL url, String proxyResult) Adds an entry to the cacheprivate StringgetFromCache(URL url) Gets an entry from the cacheprivate StringReturns the pac helper functions as a String.private StringgetPacContents(URL pacUrl) Returns the contents of file at pacUrl as a String.getProxies(URL url) Get the proxies for accessing a given URL.private StringGet the proxies for accessing a given URL.
-
Field Details
-
PROPERTY_READ_ACTION
- See Also:
-
LOG
-
pacHelperFunctionContents
-
pacContents
-
pacUrl
-
cache
-
-
Constructor Details
-
RhinoBasedPacEvaluator
Initialize a new object by using the PAC file located at the given URL.- Parameters:
pacUrl- the url of the PAC file to use
-
-
Method Details
-
getProxies
Get the proxies for accessing a given URL. The result is obtained by evaluating the PAC file with the given url (and the host) as input. This method performs caching of the result.- Specified by:
getProxiesin interfacePacEvaluator- Parameters:
url- the url for which a proxy is desired- Returns:
- a list of proxies in a string like
"PROXY foo.example.com:8080; PROXY bar.example.com:8080; DIRECT"
- See Also:
-
getProxiesWithoutCaching
Get the proxies for accessing a given URL. The result is obtained by evaluating the PAC file with the given url (and the host) as input.- Parameters:
url- the url for which a proxy is desired- Returns:
- a list of proxies in a string like
"PROXY example.com:3128; DIRECT"
- See Also:
-
getPacContents
-
getHelperFunctionContents
Returns the pac helper functions as a String. The functions are read from net/sourceforge/jnlp/resources/pac-funcs.js -
getFromCache
-
addToCache
-