ix.util.http
Class HttpUtilities

java.lang.Object
  extended by ix.util.http.HttpUtilities

public class HttpUtilities
extends java.lang.Object

Provides some utility methods for HTTP-related code.


Constructor Summary
HttpUtilities()
           
 
Method Summary
 java.lang.Object decodeReceived(java.lang.String contents)
           
 byte[] encodeForSend(java.lang.Object obj)
          Encode an object using the I-X XML representation and the UTF-8 character set.
 byte[] encodeForSend(java.lang.Object obj, java.lang.String charsetName)
          Encode an object using the I-X XML representation and the specified character set.
 java.net.URI followServerPointer(java.lang.String pointer)
           
 java.lang.String getContentCharset(java.lang.String contentType)
           
 java.lang.String getHostName()
          Returns the name of the host machine that is running the application.
 java.net.URL makeMessageURL(ServiceAddress addr, java.lang.String path)
           
 java.net.URL makeMessageURL(java.net.URI serverBase, java.lang.String path)
           
 java.lang.String readAllLines(java.io.Reader r)
           
 java.lang.String readContent(java.io.InputStream in, int len, java.lang.String charset)
           
 java.lang.String readText(java.io.InputStream in, int len, java.lang.String charset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtilities

public HttpUtilities()
Method Detail

getHostName

public java.lang.String getHostName()
Returns the name of the host machine that is running the application.

See Also:
Util.getHostName()

makeMessageURL

public java.net.URL makeMessageURL(ServiceAddress addr,
                                   java.lang.String path)

makeMessageURL

public java.net.URL makeMessageURL(java.net.URI serverBase,
                                   java.lang.String path)

followServerPointer

public java.net.URI followServerPointer(java.lang.String pointer)

encodeForSend

public byte[] encodeForSend(java.lang.Object obj)
Encode an object using the I-X XML representation and the UTF-8 character set.


encodeForSend

public byte[] encodeForSend(java.lang.Object obj,
                            java.lang.String charsetName)
Encode an object using the I-X XML representation and the specified character set.


decodeReceived

public java.lang.Object decodeReceived(java.lang.String contents)

getContentCharset

public java.lang.String getContentCharset(java.lang.String contentType)

readContent

public java.lang.String readContent(java.io.InputStream in,
                                    int len,
                                    java.lang.String charset)
                             throws java.io.IOException
Throws:
java.io.EOFException - if len > 0 and there's less content than expected.
java.io.IOException - for various other reasons.

readText

public java.lang.String readText(java.io.InputStream in,
                                 int len,
                                 java.lang.String charset)
                          throws java.io.IOException
Throws:
java.io.EOFException - if there's less content than expected.
java.io.IOException - for various other reasons.

readAllLines

public java.lang.String readAllLines(java.io.Reader r)
                              throws java.io.IOException
Throws:
java.io.IOException