Simple immutable view of a folder structure on disk or on the Internet.
Name | Type | Comment |
---|---|---|
LocalRoot | string |
The path to the root folder of interest |
Name | Type | Comment |
---|---|---|
UserName | string |
The user name for repositories on GitHub |
RepositoryName | string |
The repository name |
RemoteRoot | string |
The path to the root folder in the repository, / for the repository root |
Name | Type | Comment |
---|---|---|
Ancestors | IList<string> |
The list of ancestor folders, from the root to the folder, an empty list for the root folder |
Name | string |
The name of a file or subfolder in the folder |
Gets a root folder from a local path or remote address.
public static async Task<IFolder> RootFolderFromAsync(ILocation location)
Combines a parent folder, or path, and a name to return the path to that name. In the case of a folder, a null
parent indicates the root folder.
public static IPath Combine(IFolder? parent, string name)
public static IPath Combine(IPath parent, string name)
You can also compose calls to public IPath To(string name)
and public IPath Up()
to navigate a hierarchy of paths.
Gets the folder starting from a parent and following a path.
public static IFolder GetRelativeFolder(IFolder parent, IPath path)
Gets the folder starting from a parent and following a path.
public static IFile GetRelativeFile(IFolder parent, IPath path)
The implementation of the IFile
interface provides a public async Task LoadAsync()
method that fills the public Stream? Content { get; }
property.
Notes:
- If a file content is modified, calling
LoadAsync
updatesContent
with the new content. - If a file is deleted, calling
LoadAsync
throws an exception andContent
is left unchanged.