HttpFileSystem

Description

sealed class Tinman.Core.IO.Files.HttpFileSystem

A read-only IFileSystem implementation that accesses remote files via HTTP/HTTPS.

The HTTP/HTTPS filesystem has two roots: http:/ and https:/. It uses GET and HEAD requests to implement the IFileSystem interface, which results in the following limitations and special behaviour:

  1. File and directories listing (see IFileSystem.ListFiles and IFileSystem.ListDirectories) cannot be performed in a standardized way. To make those work as expected, it is necessary to use HttpFileListing data.

  2. Checking whether files exist (see IFileSystem.FileExists) requires extra HEAD requests. By using HttpFileListing data, these extra requests are avoided for the specified HTTP root paths.

  3. Checking whether directories exist (see IFileSystem.DirectoryExists) requires HttpFileListing data and will work as expected only for the specified HTTP root paths.

  4. Obtaining file metadata (see IFile.GetLength and IFile.GetTimestamp) requires extra HEAD requests and the presence of the Content-Length and Last-Modified response headers. File metadata is fetched lazily once and then cached during the lifetime of the HttpFile object (see HttpFile.GetMetadata).

Public / Attributes

Http


[OwnerValue]
public attribute Http → (get,set)

value : ISimpleHttp

[not-null]
The ISimpleHttp object.

The ISimpleHttp object that is used by this HttpFileSystem.

Only newly created IFile objects (see IFileSystem.FileNew) will use the new ISimpleHttp object.

Instance


public static attribute Instance → (get)

value : HttpFileSystem

[not-null]
The singleton instance.

Returns the singleton instance of HttpFileSystem.