ContentParser
Utility class for parsing parts of WARC records
Static Method Summary
Static Public Methods | ||
public static |
bufEndPosNoCRLF(buf: Buffer, bufLen: number): number Returns the index of the end of the supplied buffer that does not include |
|
public static |
parseHTTPPortion(bufs: Buffer[], req: boolean): RequestHTTP | ResponseHTTP Parses the HTTP information of WARC request and response records |
|
public static |
parseReqHTTP(headerBuffs: Buffer[]): RequestHTTP Parses the request HTTP headers |
|
public static |
parseResHTTP(headerBuffs: Buffer[]): ResponseHTTP Parses the response HTTP headers |
|
public static |
parseWarcInfoMetaDataContent(bufs: Buffer[]): Object Parse a WARC Metadata records metadata content |
|
public static |
parseWarcRecordHeader(bufs: Buffer[]): Object Parse a WARC Records headers not HTTP Header parser |
|
public static |
utf8BufferSlice(buf: Buffer, start: number, end: number): string Slices the supplied buffer returning a UTF-8 string |
Static Private Methods | ||
private static |
_parseHeaders(headerBuffs: Buffer[]): Object Parses an array of buffers containing HTTP headers |
Static Public Methods
public static bufEndPosNoCRLF(buf: Buffer, bufLen: number): number source
Returns the index of the end of the supplied buffer that does not include \r\n
public static parseHTTPPortion(bufs: Buffer[], req: boolean): RequestHTTP | ResponseHTTP source
Parses the HTTP information of WARC request and response records
public static parseReqHTTP(headerBuffs: Buffer[]): RequestHTTP source
Parses the request HTTP headers
Params:
Name | Type | Attribute | Description |
headerBuffs | Buffer[] | the request HTTP headers |
public static parseResHTTP(headerBuffs: Buffer[]): ResponseHTTP source
Parses the response HTTP headers
Params:
Name | Type | Attribute | Description |
headerBuffs | Buffer[] | the response HTTP headers |
public static parseWarcInfoMetaDataContent(bufs: Buffer[]): Object source
Parse a WARC Metadata records metadata content
Params:
Name | Type | Attribute | Description |
bufs | Buffer[] | the WARC Metadata records content lines |
public static parseWarcRecordHeader(bufs: Buffer[]): Object source
Parse a WARC Records headers not HTTP Header parser
Params:
Name | Type | Attribute | Description |
bufs | Buffer[] | the WARC Records header lines |
public static utf8BufferSlice(buf: Buffer, start: number, end: number): string source
Slices the supplied buffer returning a UTF-8 string