Difference between revisions of "THTTPFolder"

From Ultibo.org
Jump to: navigation, search
(Created page with "Return to Unit HTTP __TOC__ === Description === ---- ''To be documented'' === Class definitions === ---- <div class="toccolours mw-collapsible mw-collapse...")
 
Line 39: Line 39:
 
|-
 
|-
 
| <code>FAllowSubtree:Boolean;</code>
 
| <code>FAllowSubtree:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FHideSubfolders:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FForceTrailingSlash:Boolean;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 62: Line 70:
 
|-
 
|-
 
| <code>procedure SetAllowSubtree(AAllowSubtree:Boolean);</code>
 
| <code>procedure SetAllowSubtree(AAllowSubtree:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetHideSubfolders(AHideSubfolders:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetForceTrailingSlash(AForceTrailingSlash:Boolean);</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 96: Line 112:
 
| <code>property AllowSubtree:Boolean read FAllowSubtree write SetAllowSubtree;</code>
 
| <code>property AllowSubtree:Boolean read FAllowSubtree write SetAllowSubtree;</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property HideSubfolders:Boolean read FHideSubfolders write SetHideSubfolders;</code>
 +
| If not AllowSubtree then don't list sub folders of the configured folder
 +
|-
 +
| <code>property ForceTrailingSlash:Boolean read FForceTrailingSlash write SetForceTrailingSlash;</code>
 +
| If a folder request doesn't contain a trailing slash then redirect to add it
 
|-
 
|-
 
|}
 
|}

Revision as of 03:44, 10 February 2022

Return to Unit HTTP


Description


To be documented

Class definitions



THTTPFolder = class(THTTPDocument)

public
constructor Create;  
private
FFolder:String;  
FIndexPage:String;  
FAllowCache:Boolean;  
FAllowListing:Boolean;  
FAllowSubtree:Boolean;  
 
FHideSubfolders:Boolean;  
FForceTrailingSlash:Boolean;  
 
function GetFolder:String;  
procedure SetFolder(const AFolder:String);  
function GetIndexPage:String;  
procedure SetIndexPage(const AIndexPage:String);  
procedure SetAllowCache(AAllowCache:Boolean);  
procedure SetAllowListing(AAllowListing:Boolean);  
procedure SetAllowSubtree(AAllowSubtree:Boolean);  
 
procedure SetHideSubfolders(AHideSubfolders:Boolean);  
procedure SetForceTrailingSlash(AForceTrailingSlash:Boolean);  
protected
function DoGet(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean; override;  
function DoHead(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean; override;  
 
function DoGetFile(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse; const AFile:String):Boolean; virtual;  
function DoGetFolder(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse; const AFolder:String):Boolean; virtual;  
public
property Folder:String read GetFolder write SetFolder;  
property IndexPage:String read GetIndexPage write SetIndexPage;  
property AllowCache:Boolean read FAllowCache write SetAllowCache;  
property AllowListing:Boolean read FAllowListing write SetAllowListing;  
property AllowSubtree:Boolean read FAllowSubtree write SetAllowSubtree;  
 
property HideSubfolders:Boolean read FHideSubfolders write SetHideSubfolders; If not AllowSubtree then don't list sub folders of the configured folder
property ForceTrailingSlash:Boolean read FForceTrailingSlash write SetForceTrailingSlash; If a folder request doesn't contain a trailing slash then redirect to add it


Function declarations



constructor THTTPFolder.Create;
Description: To be documented
Note None documented


function THTTPFolder.GetFolder:String;
Description: To be documented
Note None documented


procedure THTTPFolder.SetFolder(const AFolder:String);
Description: To be documented
Note None documented


function THTTPFolder.GetIndexPage:String;
Description: To be documented
Note None documented


procedure THTTPFolder.SetIndexPage(const AIndexPage:String);
Description: To be documented
Note None documented


procedure THTTPFolder.SetAllowCache(AAllowCache:Boolean);
Description: To be documented
Note None documented


procedure THTTPFolder.SetAllowListing(AAllowListing:Boolean);
Description: To be documented
Note None documented


procedure THTTPFolder.SetAllowSubtree(AAllowSubtree:Boolean);
Description: To be documented
Note None documented


function THTTPFolder.DoGet(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean;
Description: Base GET Method for an HTTP Folder
Note None documented


function THTTPFolder.DoHead(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean;
Description: Base HEAD Method for an HTTP Folder
Note None documented


function THTTPFolder.DoGetFile(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse; const AFile:String):Boolean;
Description: To be documented
Note Caller must ensure the file exists


function THTTPFolder.DoGetFolder(AHost:THTTPHost;ARequest:THTTPServerRequest;AResponse:THTTPServerResponse;const AFolder:String):Boolean;
Description: To be documented
Note Caller must ensure the folder exists


Return to Unit Reference