Class FileSystem
The real file system.
Implements
Inherited Members
Namespace: GitCredentialManager
Assembly: Algenta.Colectica.Repository.Client.dll
Syntax
public abstract class FileSystem : IFileSystem
Properties
UserDataDirectoryPath
Get the path the the user's Git Credential Manager data directory.
Declaration
public string UserDataDirectoryPath { get; }
Property Value
Type | Description |
---|---|
string |
UserHomePath
Get the path to the user's home profile directory (Unix: $HOME, Windows: %USERPROFILE%).
Declaration
public string UserHomePath { get; }
Property Value
Type | Description |
---|---|
string |
Methods
CreateDirectory(string)
Creates all directories and subdirectories in the specified path unless they already exist.
Declaration
public void CreateDirectory(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The directory to create. |
DeleteFile(string)
Deletes the specified file.
Declaration
public void DeleteFile(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | Name of the file to be deleted. |
DirectoryExists(string)
Check if a directory exists at the specified path.
Declaration
public bool DirectoryExists(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | Full path to directory to test. |
Returns
Type | Description |
---|---|
bool | True if a directory exists, false otherwise. |
EnumerateFiles(string, string)
Returns an enumerable collection of full file names that match a search pattern in a specified path.
Declaration
public IEnumerable<string> EnumerateFiles(string path, string searchPattern)
Parameters
Type | Name | Description |
---|---|---|
string | path | The relative or absolute path to the directory to search. |
string | searchPattern | The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An enumerable collection of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern. |
FileExists(string)
Check if a file exists at the specified path.
Declaration
public bool FileExists(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | Full path to file to test. |
Returns
Type | Description |
---|---|
bool | True if a file exists, false otherwise. |
GetCurrentDirectory()
Get the path to the current directory of the currently executing process.
Declaration
public string GetCurrentDirectory()
Returns
Type | Description |
---|---|
string | Current process directory. |
IsSamePath(string, string)
Check if two paths are the same for the current platform and file system. Symbolic links are not followed.
Declaration
public abstract bool IsSamePath(string a, string b)
Parameters
Type | Name | Description |
---|---|---|
string | a | File path. |
string | b | File path. |
Returns
Type | Description |
---|---|
bool | True if both file paths are the same, false otherwise. |
OpenFileStream(string, FileMode, FileAccess, FileShare)
Open a file stream at the specified path with the given access and mode settings.
Declaration
public Stream OpenFileStream(string path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
Parameters
Type | Name | Description |
---|---|---|
string | path | Full file path. |
FileMode | fileMode | File mode settings. |
FileAccess | fileAccess | File access settings. |
FileShare | fileShare | File share settings. |
Returns
Type | Description |
---|---|
Stream |