|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KProtocolManager
public class KProtocolManager
Provides information about I/O (Internet, etc.) settings chosen/set by the end user. KProtocolManager has a heap of static functions that allows only read access to KDE's IO related settings. These include proxy, cache, file transfer resumption, timeout and user-agent related settings. The information provided by this class is generic enough to be applicable to any application that makes use of KDE's IO sub-system. Note that this mean the proxy, timeout etc. settings are saved in a separate user-specific config file and not in the config file of the application. Original author: Revised by:
KPAC
Field Summary | |
---|---|
static int |
Automatic
|
static int |
EnvVarProxy
|
static int |
ManualProxy
|
static int |
NoProxy
Types of proxy configuration NoProxy - No proxy is used ManualProxy - Proxies are manually configured PACProxy - A Proxy configuration URL has been given WPADProxy - A proxy should be automatically discovered EnvVarProxy - Use the proxy values set through environment variables. |
static int |
PACProxy
|
static int |
Prompt
Proxy authorization modes. |
static int |
WPADProxy
|
Constructor Summary | |
---|---|
|
KProtocolManager()
|
protected |
KProtocolManager(java.lang.Class dummy)
|
Method Summary | |
---|---|
static boolean |
autoResume()
Returns true if partial downloads should be automatically resumed. |
static void |
badProxy(java.lang.String proxy)
Marks this proxy as bad (down). |
static int |
cacheControl()
Returns the Cache control directive to be used. |
static java.lang.String |
cacheDir()
The directory which contains the cache files. |
static KConfig |
config()
(Shared with SlaveConfig) |
static int |
connectTimeout()
Returns the preferred timeout value for remote connections in seconds. |
static java.lang.String |
defaultUserAgent()
Returns the default user-agent string. |
static java.lang.String |
defaultUserAgent(java.lang.String keys)
Returns the default user-agent value. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
protected void |
finalize()
Deletes the wrapped C++ instance |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
static boolean |
markPartial()
Returns true if partial downloads should be marked with a ".part" extension. |
static int |
maxCacheAge()
Returns the maximum age in seconds cached files should be kept before they are deleted as necessary. |
static int |
maxCacheSize()
Returns the maximum size that can be used for caching. |
static int |
minimumKeepSize()
Returns the minimum file size for keeping aborted downloads. |
static java.lang.String |
noProxyFor()
Returns a comma-separated list of hostnames or partial host-names that should bypass any proxy settings. |
static boolean |
persistentConnections()
Returns true if connections should be persistent |
static boolean |
persistentProxyConnection()
Returns true if proxy connections should be persistent. |
static int |
proxyAuthMode()
Returns the way proxy authorization should be handled. |
static java.lang.String |
proxyConfigScript()
Returns the URL of the script for automatic proxy configuration. |
static int |
proxyConnectTimeout()
Returns the preferred timeout value for proxy connections in seconds. |
static java.lang.String |
proxyFor(java.lang.String protocol)
Returns the proxy server address for a given protocol. |
static java.lang.String |
proxyForURL(KURL url)
Returns the proxy server address for a given URL. |
static int |
proxyType()
Returns the type of proxy configuration that is used. |
static int |
readTimeout()
Returns the preferred timeout value for reading from remote connections in seconds. |
static void |
reparseConfiguration()
Force a reload of the general config file of io-slaves ( kioslaverc). |
static int |
responseTimeout()
Returns the preferred response timeout value for remote connecting in seconds. |
static java.lang.String |
slaveProtocol(KURL url,
java.lang.StringBuffer proxy)
Return the protocol to use in order to handle the given url
It's usually the same, except that FTP, when handled by a proxy,
needs an HTTP ioslave. |
static boolean |
useCache()
Returns true/false to indicate whether a cache should be used |
static boolean |
useProxy()
Returns true if the user specified a proxy server to make connections. |
static java.lang.String |
userAgentForHost(java.lang.String hostname)
Returns the userAgent string configured for the specified host. |
static boolean |
useReverseProxy()
Returns true if the proxy settings should apply to the list returned by noProxyFor() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NoProxy
public static final int ManualProxy
public static final int PACProxy
public static final int WPADProxy
public static final int EnvVarProxy
public static final int Prompt
public static final int Automatic
Constructor Detail |
---|
protected KProtocolManager(java.lang.Class dummy)
public KProtocolManager()
Method Detail |
---|
public static java.lang.String defaultUserAgent()
public static java.lang.String defaultUserAgent(java.lang.String keys)
keys
- can be any of the following:
keys
public static java.lang.String userAgentForHost(java.lang.String hostname)
hostname
- name of the host
public static int readTimeout()
public static int connectTimeout()
public static int proxyConnectTimeout()
public static int responseTimeout()
public static boolean useProxy()
slaveProtocol(org.kde.koala.KURL, java.lang.StringBuffer)
,
proxyForURL(org.kde.koala.KURL)
,
proxyFor(java.lang.String)
public static boolean useReverseProxy()
noProxyFor()
.
Normally addresses listed in the noProxyFor list are not routed
through a proxy server. However, if this function returns true,
then all addresses listed in the noProxyFor list are to be routed
through a proxy server where as those that are not should bypass it.
This function as well as noProxyFor()
only apply when proxyType()
is ManualProxy.
proxyForURL(org.kde.koala.KURL)
,
proxyFor(java.lang.String)
,
slaveProtocol(org.kde.koala.KURL, java.lang.StringBuffer)
public static int proxyType()
ProxyType
public static int proxyAuthMode()
ProxyAuthMode
public static java.lang.String noProxyFor()
useReverseProxy()
only apply
when proxyType()
is ManualProxy.
useReverseProxy()
,
proxyFor(java.lang.String)
,
proxyForURL(org.kde.koala.KURL)
,
slaveProtocol(org.kde.koala.KURL, java.lang.StringBuffer)
public static java.lang.String proxyFor(java.lang.String protocol)
useReverseProxy()
settings into account.
protocol
- the protocol whose proxy info is needed
useReverseProxy()
,
slaveProtocol(org.kde.koala.KURL, java.lang.StringBuffer)
public static java.lang.String proxyForURL(KURL url)
proxyType()
returns Automatic, an external service
called KPAC (a kded module) is used to determine the proxy
server. Otherwise, proxyFor(java.lang.String)
is invoked to determine
whether the URL needs to be routed through a proxy server.
NOTE: This function does not take the useReverseProxy()
or the noProxyFor()
settings into account.
url
- the URL whose proxy info is needed
useReverseProxy()
,
slaveProtocol(org.kde.koala.KURL, java.lang.StringBuffer)
,
noProxyFor()
public static void badProxy(java.lang.String proxy)
proxy
- the proxy to mark as bad (as URL)public static java.lang.String proxyConfigScript()
public static boolean useCache()
public static int maxCacheAge()
public static int maxCacheSize()
public static java.lang.String cacheDir()
public static int cacheControl()
public static boolean autoResume()
public static boolean markPartial()
public static int minimumKeepSize()
public static boolean persistentProxyConnection()
public static boolean persistentConnections()
public static void reparseConfiguration()
public static java.lang.String slaveProtocol(KURL url, java.lang.StringBuffer proxy)
url
It's usually the same, except that FTP, when handled by a proxy,
needs an HTTP ioslave.
When a proxy is to be used, proxy contains the URL for the proxy.
url
- the url to checkproxy
- the URL of the proxy to use
public static KConfig config()
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |