| java.lang.Object edu.indiana.lib.twinpeaks.util.HttpTransactionUtils
HttpTransactionUtils | public class HttpTransactionUtils (Code) | | HTTP utilites
|
DEFAULTCS | final public static String DEFAULTCS(Code) | | Default HTTP character set
|
FILE | final public static String FILE(Code) | | /file/specification
|
FILEANDPARAMS | final public static String FILEANDPARAMS(Code) | | /file/specification?parameter1=value1¶meter2=value2
|
PARAMETERS | final public static String PARAMETERS(Code) | | ?parameter1=value1¶meter2=value2
|
SERVER | final public static String SERVER(Code) | | protocol://server
|
formatParameter | public static String formatParameter(String name, String value)(Code) | | Format one HTTP parameter
Parameters: name - Parameter name Parameters: value - Parameter value (URLEncoded using default chracter set) Parameter text (ampersand+name=url-encoded-value) |
formatParameter | public static String formatParameter(String name, String value, String separator, String cs)(Code) | | Format one HTTP parameter
Parameters: name - Parameter name Parameters: value - Parameter value (will be URLEncoded) Parameters: separator - Character to separate parameters Parameters: cs - Character set specification (utf-8, etc) Parameter text (separator+name=url-encoded-value) |
formatUrl | public static String formatUrl(URL url) throws MalformedURLException(Code) | | Format a base URL string ( protocol://server[:port] )
Parameters: url - URL to format URL string |
formatUrl | public static String formatUrl(URL url, boolean preserveFile) throws MalformedURLException(Code) | | Format a base URL string ( protocol://server[:port][/file-specification] )
Parameters: url - URL to format Parameters: preserveFile - Keep the /directory/filename portion of the URL? URL string |
getAttributesAsMap | public static Map getAttributesAsMap(HttpServletRequest request)(Code) | | Set up a simple Map of HTTP request parameters (assumes no duplicate names)
Parameters: request - HttpServletRequest object Map of name=value pairs |
getServer | public static String getServer(String url)(Code) | | Pull the server [and port] from a URL specification
Parameters: url - URL string server[:port] |
getUrlComponent | public static String getUrlComponent(String url, String component) throws MalformedURLException(Code) | | Fetch a component from a URL string
Parameters: url - URL String Parameters: component - name (one of server, file, parameters, fileandparameters) URL component string (null if none) |
isHttpError | public static boolean isHttpError(int status)(Code) | | General "did an error occur"?
true if so |
isHttpInfo | public static boolean isHttpInfo(int status)(Code) | | Informational status?
true if so |
isHttpRedirect | public static boolean isHttpRedirect(int status)(Code) | | HTTP redirect?
true if so |
isHttpRequestError | public static boolean isHttpRequestError(int status)(Code) | | Error in request?
true if so |
isHttpServerError | public static boolean isHttpServerError(int status)(Code) | | Server error?
true if so |
isHttpSuccess | public static boolean isHttpSuccess(int status)(Code) | | Success status?
true if so |
urlEncodeFullUrl | public static String urlEncodeFullUrl(String original)(Code) | | URLEncode parameter names and values
Parameters: original - Full URL specification (http://example.com/xxx?a=b&c=d) Original URL with (possibly) encoded parameters |
urlEncodeParameters | public static String urlEncodeParameters(String original)(Code) | | URLEncode parameter names and values
Parameters: original - Original parameter list (?a=b&c=d) Possibly encoded parameter list |
|
|