com.limegroup.gnutella.http
Class HTTPHeaderName

java.lang.Object
  extended by com.limegroup.gnutella.http.HTTPHeaderName

public class HTTPHeaderName
extends java.lang.Object

This class defines an "enum" for HTTP header names, following the typesafe enum pattern.


Field Summary
static HTTPHeaderName ACCEPT_ENCODING
          Header for specifying the type of encoding we'll accept.
static HTTPHeaderName ALT_LOCATION
          Header for new alternate file locations, as per new spec.
static HTTPHeaderName AVAILABLE_RANGES
          Header for the available ranges of a file currently available, as specified in the Partial File Sharing Protocol.
static HTTPHeaderName BFALT_LOCATION
          Header for bad alternate locations behind firewalls.
static HTTPHeaderName CONNECTION
          Header for specifying whether the connection should be kept alive or closed when using HTTP 1.1.
static HTTPHeaderName CONTENT_ENCODING
          Header for specifying the type of encoding we'll send.
static HTTPHeaderName CONTENT_LENGTH
          Header for specifying the length of the content, in bytes.
static HTTPHeaderName CONTENT_RANGE
          Header for specifying the byte range of the content.
static HTTPHeaderName CONTENT_TYPE
          Header for specifying the type of content.
static HTTPHeaderName CONTENT_URN
          Header for specifying the URN of the file, as per the CAW spec at http://www.open-content.net/specs/draft-jchapweske-caw-03.html .
static HTTPHeaderName CREATION_TIME
          Header for creation time.
static HTTPHeaderName DATE
          Constant header for the date.
static HTTPHeaderName FALT_LOCATION
          Header for alternate locations behind firewalls.
static HTTPHeaderName FEATURES
          Header for submitting supported features.
static HTTPHeaderName GNUTELLA_CONTENT_URN
          Header for specifying the URN of the file, as per HUGE v0.94.
static HTTPHeaderName NALTS
          Header for failed Alternate locations to be removed from the mesh.
static HTTPHeaderName NODE
          Header for sending your own ": "
static HTTPHeaderName OLD_ALT_LOCS
          Header that used to be used for alternate locations, as per HUGE v0.94.
static HTTPHeaderName PROXIES
          Header for updating the set of push proxies for a host.
static HTTPHeaderName QUEUE
          Header for queued downloads.
static HTTPHeaderName QUEUE_HEADER
          Custom header for upload queues.
static HTTPHeaderName RETRY_AFTER
          Header for retry after.
static HTTPHeaderName SERVER
          Response header for specifying the server name and version.
static HTTPHeaderName THEX_URI
          Header for specifying a THEX URI.
 
Method Summary
 java.lang.String httpStringValue()
          Accessor to obtain the string representation of the header as it should be written out to the network.
 boolean matchesStartOfString(java.lang.String str)
          Returns whether or not the start of the passed in string matches the string representation of this HTTP header, ignoring case.
 java.lang.String toString()
          Overrides Object.toString to give a more informative description of the header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALT_LOCATION

public static final HTTPHeaderName ALT_LOCATION
Header for new alternate file locations, as per new spec.


FALT_LOCATION

public static final HTTPHeaderName FALT_LOCATION
Header for alternate locations behind firewalls.


BFALT_LOCATION

public static final HTTPHeaderName BFALT_LOCATION
Header for bad alternate locations behind firewalls.


OLD_ALT_LOCS

public static final HTTPHeaderName OLD_ALT_LOCS
Header that used to be used for alternate locations, as per HUGE v0.94.


NALTS

public static final HTTPHeaderName NALTS
Header for failed Alternate locations to be removed from the mesh.


GNUTELLA_CONTENT_URN

public static final HTTPHeaderName GNUTELLA_CONTENT_URN
Header for specifying the URN of the file, as per HUGE v0.94.


CONTENT_URN

public static final HTTPHeaderName CONTENT_URN
Header for specifying the URN of the file, as per the CAW spec at http://www.open-content.net/specs/draft-jchapweske-caw-03.html .


CONTENT_RANGE

public static final HTTPHeaderName CONTENT_RANGE
Header for specifying the byte range of the content.


CONTENT_TYPE

public static final HTTPHeaderName CONTENT_TYPE
Header for specifying the type of content.


CONTENT_LENGTH

public static final HTTPHeaderName CONTENT_LENGTH
Header for specifying the length of the content, in bytes.


ACCEPT_ENCODING

public static final HTTPHeaderName ACCEPT_ENCODING
Header for specifying the type of encoding we'll accept.


CONTENT_ENCODING

public static final HTTPHeaderName CONTENT_ENCODING
Header for specifying the type of encoding we'll send.


SERVER

public static final HTTPHeaderName SERVER
Response header for specifying the server name and version.


QUEUE_HEADER

public static final HTTPHeaderName QUEUE_HEADER
Custom header for upload queues.


CONNECTION

public static final HTTPHeaderName CONNECTION
Header for specifying whether the connection should be kept alive or closed when using HTTP 1.1.


THEX_URI

public static final HTTPHeaderName THEX_URI
Header for specifying a THEX URI. THEX URIs are of the form:

X-Thex-URI: ; .

This informs the client where the full Tiger tree hash can be retrieved.


DATE

public static final HTTPHeaderName DATE
Constant header for the date.


AVAILABLE_RANGES

public static final HTTPHeaderName AVAILABLE_RANGES
Header for the available ranges of a file currently available, as specified in the Partial File Sharing Protocol. This takes the save form as the Content-Range header, as in:

X-Available-Ranges: bytes 0-10,20-30


QUEUE

public static final HTTPHeaderName QUEUE
Header for queued downloads.


RETRY_AFTER

public static final HTTPHeaderName RETRY_AFTER
Header for retry after. Useful for two things: 1) LimeWire can now be queued in gtk-gnutella's PARQ 2) It's possible to tune the number of http requests down when LimeWire is busy


CREATION_TIME

public static final HTTPHeaderName CREATION_TIME
Header for creation time. Allows the creation time of the file to propagate throughout the network.


FEATURES

public static final HTTPHeaderName FEATURES
Header for submitting supported features. Introduced by BearShare. Example: X-Features: chat/0.1, browse/1.0, queue/0.1


PROXIES

public static final HTTPHeaderName PROXIES
Header for updating the set of push proxies for a host. Defined in section 4.2 of the Push Proxy proposal, v. 0.7


NODE

public static final HTTPHeaderName NODE
Header for sending your own ": "

Method Detail

matchesStartOfString

public boolean matchesStartOfString(java.lang.String str)
Returns whether or not the start of the passed in string matches the string representation of this HTTP header, ignoring case.

Parameters:
str - the string to check for a match
Returns:
true if the passed in string matches the string representation of this HTTP header (ignoring case), otherwise returns false

httpStringValue

public java.lang.String httpStringValue()
Accessor to obtain the string representation of the header as it should be written out to the network.

Returns:
the HTTP header name as a string

toString

public java.lang.String toString()
Overrides Object.toString to give a more informative description of the header.

Overrides:
toString in class java.lang.Object
Returns:
the string description of this instance