# PHTTPTailFile Class Reference

This object describes a HyperText Transport Protocol resource which is a single file. More...

`#include <http.h>`

Inheritance diagram for PHTTPTailFile:

List of all members.

## Public Member Functions

| PHTTPTailFile (const PString &filename)
| Contruct a new simple file resource for the HTTP space.
| PHTTPTailFile (const PString &filename, const PHTTPAuthority &auth)
| PHTTPTailFile (const PURL &url, const PFilePath &file)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PString &contentType)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PHTTPAuthority &auth)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PString &contentType, const PHTTPAuthority &auth)
virtual PBoolean | LoadHeaders (PHTTPRequest &request)
| Get the headers for block of data (eg HTML) that the resource contains.
virtual PBoolean | LoadData (PHTTPRequest &request, PCharArray &data)
| Get a block of data that the resource contains.

## Detailed Description

This object describes a HyperText Transport Protocol resource which is a single file.

The file can be anywhere in the file system and is mapped to the specified URL location in the HTTP name space defined by the `PHTTPSpace` class.

The difference between this and PHTTPFile is that it continually outputs the contents of the file, as per the unix "tail -f" command.

## Constructor & Destructor Documentation

PHTTPTailFile::PHTTPTailFile | ( | const PString & | filename | ) |

Contruct a new simple file resource for the HTTP space.

If no MIME content type is specified then a default type is used depending on the file type. For example, "text/html" is used of the file type is ".html" or ".htm". The default for an unknown type is "application/octet-stream".

PHTTPTailFile::PHTTPTailFile | ( | const PString & | filename,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file |
| ) |  |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PString & | contentType |
| ) |  |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PString & | contentType,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

## Member Function Documentation

virtual PBoolean PHTTPTailFile::LoadData | ( | PHTTPRequest & | request,
|  | PCharArray & | data |
| ) |  |  | `[virtual]`

Get a block of data that the resource contains.

Returns:
  true if more to load.

Reimplemented from PHTTPFile.

virtual PBoolean PHTTPTailFile::LoadHeaders | ( | PHTTPRequest & | request | ) | `[virtual]`

Get the headers for block of data (eg HTML) that the resource contains.

This will fill in all the fields of the `outMIME` parameter required by the resource and return the status for the load.

Returns:
  true if all OK, false if an error occurred.

Reimplemented from PHTTPFile.

The documentation for this class was generated from the following file:

- http.h