|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xmlrpc.util.HttpUtil
public class HttpUtil
Provides utility functions useful in HTTP communications
Constructor Summary | |
---|---|
HttpUtil()
|
Method Summary | |
---|---|
static java.lang.String |
encodeBasicAuthentication(java.lang.String pUser,
java.lang.String pPassword,
java.lang.String pEncoding)
Creates the Base64 encoded credentials for HTTP Basic Authentication. |
static java.lang.String |
getNonIdentityTransferEncoding(java.lang.String pHeaderValue)
Returns, whether the HTTP header value pHeaderValue
indicates, that another encoding than "identity" is used. |
static boolean |
isUsingGzipEncoding(java.util.Enumeration pValues)
Returns, whether the HTTP header values in pValues
indicate, that GZIP encoding is used or may be used. |
static boolean |
isUsingGzipEncoding(java.lang.String pHeaderValue)
Returns, whether the HTTP header value pHeaderValue
indicates, that GZIP encoding is used or may be used. |
static void |
parseAuthorization(XmlRpcHttpRequestConfigImpl pConfig,
java.lang.String pLine)
Parses an "Authorization" header and adds the username and password to pConfig . |
static java.lang.String |
readLine(java.io.InputStream pIn,
byte[] pBuffer)
Reads a header line from the input stream pIn
and converts it into a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpUtil()
Method Detail |
---|
public static java.lang.String encodeBasicAuthentication(java.lang.String pUser, java.lang.String pPassword, java.lang.String pEncoding) throws java.io.UnsupportedEncodingException
pUser
- User name, or null, if no Basic Authentication is being used.pPassword
- Users password, or null, if no Basic Authentication is being used.pEncoding
- Encoding being used for conversion of the credential string into a byte array.
java.io.UnsupportedEncodingException
- The encoding pEncoding
is invalid.public static boolean isUsingGzipEncoding(java.lang.String pHeaderValue)
pHeaderValue
indicates, that GZIP encoding is used or may be used.
pHeaderValue
- The HTTP header value being parsed. This is typically
the value of "Content-Encoding", or "Accept-Encoding".
public static java.lang.String getNonIdentityTransferEncoding(java.lang.String pHeaderValue)
pHeaderValue
indicates, that another encoding than "identity" is used.
This is typically the value of "Transfer-Encoding", or "TE".
public static boolean isUsingGzipEncoding(java.util.Enumeration pValues)
pValues
indicate, that GZIP encoding is used or may be used.
pValues
- The HTTP header values being parsed. These are typically
the values of "Content-Encoding", or "Accept-Encoding".
public static java.lang.String readLine(java.io.InputStream pIn, byte[] pBuffer) throws java.io.IOException
pIn
and converts it into a string.
pIn
- The input stream being read.pBuffer
- A buffer being used for temporary storage.
The buffers length is a limit of the header lines length.
java.io.IOException
- Reading the header line failed.public static void parseAuthorization(XmlRpcHttpRequestConfigImpl pConfig, java.lang.String pLine)
pConfig
.
pConfig
- The request configuration being created.pLine
- The header being parsed, including the "basic" part.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |