Qt Jambi Home

com.trolltech.qt.network
Class QHttpResponseHeader

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.network.QHttpHeader
              extended by com.trolltech.qt.network.QHttpResponseHeader
All Implemented Interfaces:
QtJambiInterface

public class QHttpResponseHeader
extends QHttpHeader

The QHttpResponseHeader class contains response header information for HTTP.

This class is used by the QHttp class to report the header information that the client received from the server.

HTTP responses have a status code that indicates the status of the response. This code is a 3-digit integer result code (for details see to RFC 1945). In addition to the status code, you can also specify a human-readable text that describes the reason for the code ("reason phrase"). This class allows you to get the status code and the reason phrase.

See Also:
QHttpRequestHeader, QHttp, HTTP Example

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QHttpResponseHeader()
          Constructs an empty HTTP response header.
QHttpResponseHeader(int code)
          Equivalent to QHttpResponseHeader(code, QString(), 1, 1).
QHttpResponseHeader(int code, java.lang.String text)
          Equivalent to QHttpResponseHeader(code, text, 1, 1).
QHttpResponseHeader(int code, java.lang.String text, int majorVer)
          Equivalent to QHttpResponseHeader(code, text, majorVer, 1).
QHttpResponseHeader(int code, java.lang.String text, int majorVer, int minorVer)
          Constructs a QHttpResponseHeader, setting the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.
QHttpResponseHeader(QHttpResponseHeader header)
          Constructs a copy of header.
QHttpResponseHeader(java.lang.String str)
          Constructs a HTTP response header from the string str.
 
Method Summary
static QHttpResponseHeader fromNativePointer(QNativePointer nativePointer)
          This function returns the QHttpResponseHeader instance pointed to by nativePointer
 int majorVersion()
          Returns the major protocol-version of the HTTP response header.
 int minorVersion()
          Returns the minor protocol-version of the HTTP response header.
static QNativePointer nativePointerArray(QHttpResponseHeader[] array)
          This function returns a QNativePointer that is pointing to the specified QHttpResponseHeader array.
protected  boolean parseLine(java.lang.String line, int number)
          This function is reimplemented for internal reasons.
 java.lang.String reasonPhrase()
          Returns the reason phrase of the HTTP response header.
 void setStatusLine(int code)
          Equivalent to setStatusLine(code, QString(), 1, 1).
 void setStatusLine(int code, java.lang.String text)
          Equivalent to setStatusLine(code, text, 1, 1).
 void setStatusLine(int code, java.lang.String text, int majorVer)
          Equivalent to setStatusLine(code, text, majorVer, 1).
 void setStatusLine(int code, java.lang.String text, int majorVer, int minorVer)
          Sets the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.
 int statusCode()
          Returns the status code of the HTTP response header.
 java.lang.String toString()
          This function is reimplemented for internal reasons.
 
Methods inherited from class com.trolltech.qt.network.QHttpHeader
addValue, allValues, contentLength, contentType, hasContentLength, hasContentType, hasKey, isValid, keys, parse, removeAllValues, removeValue, setContentLength, setContentType, setValid, setValue, setValues, value, values
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QHttpResponseHeader

public QHttpResponseHeader(java.lang.String str)

Constructs a HTTP response header from the string str. The string is parsed and the information is set. The str should consist of one or more "\r\n" delimited lines; the first line should be the status-line (format: HTTP-version, space, status-code, space, reason-phrase); each of remaining lines should have the format key, colon, space, value.


QHttpResponseHeader

public QHttpResponseHeader(int code,
                           java.lang.String text,
                           int majorVer)

Equivalent to QHttpResponseHeader(code, text, majorVer, 1).


QHttpResponseHeader

public QHttpResponseHeader(int code,
                           java.lang.String text)

Equivalent to QHttpResponseHeader(code, text, 1, 1).


QHttpResponseHeader

public QHttpResponseHeader(int code)

Equivalent to QHttpResponseHeader(code, QString(), 1, 1).


QHttpResponseHeader

public QHttpResponseHeader(int code,
                           java.lang.String text,
                           int majorVer,
                           int minorVer)

Constructs a QHttpResponseHeader, setting the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.

See Also:
statusCode, reasonPhrase, majorVersion, minorVersion

QHttpResponseHeader

public QHttpResponseHeader(QHttpResponseHeader header)

Constructs a copy of header.


QHttpResponseHeader

public QHttpResponseHeader()

Constructs an empty HTTP response header.

Method Detail

reasonPhrase

public final java.lang.String reasonPhrase()

Returns the reason phrase of the HTTP response header.

See Also:
statusCode, majorVersion, minorVersion

setStatusLine

public final void setStatusLine(int code,
                                java.lang.String text,
                                int majorVer)

Equivalent to setStatusLine(code, text, majorVer, 1).


setStatusLine

public final void setStatusLine(int code,
                                java.lang.String text)

Equivalent to setStatusLine(code, text, 1, 1).


setStatusLine

public final void setStatusLine(int code)

Equivalent to setStatusLine(code, QString(), 1, 1).


setStatusLine

public final void setStatusLine(int code,
                                java.lang.String text,
                                int majorVer,
                                int minorVer)

Sets the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.

See Also:
statusCode, reasonPhrase, majorVersion, minorVersion

statusCode

public final int statusCode()

Returns the status code of the HTTP response header.

See Also:
reasonPhrase, majorVersion, minorVersion

majorVersion

public int majorVersion()

Returns the major protocol-version of the HTTP response header.

Specified by:
majorVersion in class QHttpHeader
See Also:
minorVersion, statusCode, reasonPhrase

minorVersion

public int minorVersion()

Returns the minor protocol-version of the HTTP response header.

Specified by:
minorVersion in class QHttpHeader
See Also:
majorVersion, statusCode, reasonPhrase

parseLine

protected boolean parseLine(java.lang.String line,
                            int number)

This function is reimplemented for internal reasons.

Overrides:
parseLine in class QHttpHeader
See Also:
parse

toString

public java.lang.String toString()

This function is reimplemented for internal reasons.

Overrides:
toString in class QHttpHeader

fromNativePointer

public static QHttpResponseHeader fromNativePointer(QNativePointer nativePointer)
This function returns the QHttpResponseHeader instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QHttpResponseHeader[] array)
This function returns a QNativePointer that is pointing to the specified QHttpResponseHeader array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

Qt Jambi Home