Package com.adobe.xfa.ut
Class Resolver
java.lang.Object
com.adobe.xfa.ut.Resolver
A class to provide some utility methods in support of some
protocol I/O capabilities.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Canon(ize) an url into its constituent parts.static void
crackUrl
(String sUrl, StringHolder sScheme, StringHolder sUser, StringHolder sPwd, StringHolder sHost, StringHolder sPort, StringHolder sPath) Crack an url into its constituent parts.static Protocol
getProtocol
(String sScheme) Get the currently installed protocol handler associated with the given scheme.static void
Uninstall all protocol handlers.static void
setProtocol
(Protocol oProtocol) Sets (adds) the given protocol to the list of protocol handlers.static String
Decode a URL encoded stringstatic String
URL encode a string
-
Field Details
-
gsServerIndicator
- See Also:
-
-
Method Details
-
setProtocol
Sets (adds) the given protocol to the list of protocol handlers.- Parameters:
oProtocol
- a protocol handler. Subsequent to this operation, the I/O of any URL whose scheme matches the given protocol will be routed to the given protocol handler.
-
resetProtocols
public static void resetProtocols()Uninstall all protocol handlers. It is normally not necessary to make this call, as protocol handlers are automatically deleted on exit. However, when a protocol handler is in a DLL that is dynamically loaded, it is possible for that DLL to be unloaded before the automatic deletion takes place, leading to a crash. In that case the DLL must call ResetProtocols just prior to unloading (for example in the destructor of a global variable). -
getProtocol
Get the currently installed protocol handler associated with the given scheme.- Parameters:
sScheme
- a URL's scheme.- Returns:
- the matching protocol handler.
-
crackUrl
public static void crackUrl(String sUrl, StringHolder sScheme, StringHolder sUser, StringHolder sPwd, StringHolder sHost, StringHolder sPort, StringHolder sPath) Crack an url into its constituent parts. The URL is cracked from the following rule:scheme://[user[:password]@]host[:port][/path]
- Parameters:
sUrl
- the URL to crack.sScheme
- the cracked URL's scheme.sUser
- the cracked URL's user, if any.sPwd
- the cracked URL's password, if any.sHost
- the cracked URL's host.sPort
- the cracked URL's port, if any.sPath
- the cracked URL's path, if any.
-
canonUrl
Canon(ize) an url into its constituent parts. The URL is canonized into the following rule:scheme://host[:port][/path]
- Parameters:
sScheme
- the URL's scheme.sHost
- the URL's host.sPort
- the URL's port, if any.sPath
- the URL's path, if any.- Returns:
- The canonized URL.
-
urlEncode
URL encode a string- Parameters:
sUrl
- string to be encoded- Returns:
- URL encoded string
-
urlDecode
Decode a URL encoded string- Parameters:
sUrl
- string to be decoded- Returns:
- Decoded string
-