HttpFileListing
Description
The HttpFileListing class holds a list of URLs which are known to point to existing resources, which is used by HttpFileSystem to implement IFileSystem.ListDirectories and IFileSystem.ListFiles.
The workflow involving HttpFileListing data looks like this:
-
Use Build to create a HttpFileListing for a directory structure on the local system.
-
Call Save to write an HTTP listing file.
-
Upload the HTTP listing file to a server where it is accessible as a document in the root HTTP URL, for example:
https://my.domain.com/root/listing.txt -
Call Fetch to obtain a HttpFileListing object for a root HTTP URL. For the above example, the root URL would be:
https://my.domain.com/root/ -
Use HttpFile.ListingAdd and HttpFile.ListingRemove to provide HttpFileListing objects for being used by the singleton HttpFileSystem object.
Actions 1 to 3 are usually performed in a separate preparation step. Applications performs actions 4 and 5 at runtime to set up its remote resources, usually at initialization time.
Public / Constructors
Build
Build a listing for an HTTP base URL, using Path.FindAll with the given filter opt and recur opt predicates.
- IOException
-
If an I/O error has occurred.
Load
2 overloads
Creates a new instance of HttpFileListing from an HTTP listing file.
- IOException
-
If an I/O error has occurred.
Creates a new instance of HttpFileListing from HTTP listing file content.
Public / Methods
Save
Saves this HTTP listing to the given local file.
Use Load1 to load a HTTP listing file, for testing and debugging.
- IOException
-
If an I/O error has occurred.
Public / Attributes
Entries
Returns the HTTP listing entries.
Each entry is a relative path, to be resolved against BasePath, using slashes to separate path elements (see Path.ToSeparator), having a trailing separator iff the entry represents a directory.