Class HttpHeaders
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<HttpHeader>,Collection<HttpHeader>,List<HttpHeader>,RandomAccess,HttpConstants,HttpHeaderObserver
- Author:
- brad
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCountFields inherited from interface org.archive.format.http.HttpConstants
COLON, CR, CRLF, HTAB, LF, METHOD_CONNECT, METHOD_CONNECT_STRING, METHOD_DELETE, METHOD_DELETE_STRING, METHOD_GET, METHOD_GET_STRING, METHOD_HEAD, METHOD_HEAD_STRING, METHOD_POST, METHOD_POST_STRING, METHOD_PUT, METHOD_PUT_STRING, METHOD_TRACE, METHOD_TRACE_STRING, METHOD_UNK, METHOD_UNK_STRING, REASON_UNK, SP, STATUS_UNK, UTF8, VERSION_0, VERSION_0_STATUS, VERSION_1, VERSION_1_STATUS, VERSION_1_UNK, VERSION_9, VERSION_9_STATUS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new Header with the given Name/Value, allowing duplicates, which may not be what you want.voidaddDateHeader(String name, long ms) voidaddDateHeader(String name, Date d) longintOnly valid if these Headers were read via an HTTP Parser.voidheaderParsed(byte[] name, int ns, int nl, byte[] value, int vs, int vl) voidheadersComplete(int bytesRead) voidbooleanvoidAdd a new Header with the given name/value, or replace an existing value if a Header already exists with namevoidsetDateHeader(String name, long ms) voidsetDateHeader(String name, Date d) toString()voidwrite(OutputStream out) Write all Headers and a trailing CRLF, CRLFMethods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractList
equals, hashCodeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, streamMethods inherited from interface java.util.List
containsAll, equals, hashCode
-
Constructor Details
-
HttpHeaders
public HttpHeaders()
-
-
Method Details
-
setDateHeader
-
setDateHeader
-
addDateHeader
-
addDateHeader
-
get
-
getValue
-
getValueCaseInsensitive
-
getContentLength
public long getContentLength() -
toString
- Overrides:
toStringin classAbstractCollection<HttpHeader>
-
headerParsed
public void headerParsed(byte[] name, int ns, int nl, byte[] value, int vs, int vl) - Specified by:
headerParsedin interfaceHttpHeaderObserver
-
headersComplete
public void headersComplete(int bytesRead) - Specified by:
headersCompletein interfaceHttpHeaderObserver
-
headersCorrupt
public void headersCorrupt()- Specified by:
headersCorruptin interfaceHttpHeaderObserver
-
isCorrupt
public boolean isCorrupt() -
getTotalBytes
public int getTotalBytes()Only valid if these Headers were read via an HTTP Parser.- Returns:
- the number of bytes read to produce these headers
-
set
-
add
-
write
Write all Headers and a trailing CRLF, CRLF- Parameters:
out-- Throws:
IOException
-