C# Class Octopus.Cli.Util.OctopusPhysicalFileSystem

Inheritance: IOctopusFileSystem
Afficher le fichier Open project: OctopusDeploy/Octo.exe

Méthodes publiques

Méthode Description
AppendToFile ( string path, string contents ) : void
CopyDirectory ( string sourceDirectory, string targetDirectory, CancellationToken cancel, int overwriteFileRetryAttempts = 3 ) : void
CopyDirectory ( string sourceDirectory, string targetDirectory, int overwriteFileRetryAttempts = 3 ) : void
CopyFile ( string sourceFile, string targetFile, int overwriteFileRetryAttempts = 3 ) : ReplaceStatus
CreateTemporaryDirectory ( ) : string
CreateTemporaryFile ( string extension, string &path ) : Stream
DeleteDirectory ( string path ) : void
DeleteDirectory ( string path, DeletionOptions options ) : void
DeleteFile ( string path ) : void
DeleteFile ( string path, DeletionOptions options ) : void
DirectoryExists ( string path ) : bool
DirectoryIsEmpty ( string path ) : bool
EnsureDirectoryExists ( string directoryPath ) : void
EnsureDiskHasEnoughFreeSpace ( string directoryPath ) : void
EnsureDiskHasEnoughFreeSpace ( string directoryPath, long requiredSpaceInBytes ) : void
EnumerateDirectories ( string parentDirectoryPath ) : IEnumerable
EnumerateDirectoriesRecursively ( string parentDirectoryPath ) : IEnumerable
EnumerateFiles ( string parentDirectoryPath ) : IEnumerable
EnumerateFilesRecursively ( string parentDirectoryPath ) : IEnumerable
EqualHash ( Stream first, Stream second ) : bool
FileExists ( string path ) : bool
GetFileSize ( string path ) : long
GetFullPath ( string relativeOrAbsoluteFilePath ) : string
MoveFile ( string sourceFile, string destinationFile ) : void
OctopusPhysicalFileSystem ( ILogger log ) : System
OpenFile ( string path, FileAccess access, FileShare share ) : Stream
OpenFile ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream
OverwriteAndDelete ( string originalFile, string temporaryReplacement ) : void
OverwriteFile ( string path, string contents ) : void
ReadAllText ( string scriptFile ) : string
ReadFile ( string path ) : string
RemoveInvalidFileNameChars ( string path ) : string
Replace ( string oldFilePath, Stream newStream, int overwriteFileRetryAttempts = 3 ) : ReplaceStatus

Creates, updates or skips a file based on a file content comparison

Useful for cases where you do not want a file's timestamp to change when overwriting it with identical contents or you want clearer logging as to what changed.

WriteAllBytes ( string filePath, byte data ) : void

Private Methods

Méthode Description
GetDiskFreeSpaceEx ( string lpDirectoryName, ulong &lpFreeBytesAvailable, ulong &lpTotalNumberOfBytes, ulong &lpTotalNumberOfFreeBytes ) : bool
GetTempBasePath ( ) : string

Method Details

AppendToFile() public méthode

public AppendToFile ( string path, string contents ) : void
path string
contents string
Résultat void

CopyDirectory() public méthode

public CopyDirectory ( string sourceDirectory, string targetDirectory, CancellationToken cancel, int overwriteFileRetryAttempts = 3 ) : void
sourceDirectory string
targetDirectory string
cancel System.Threading.CancellationToken
overwriteFileRetryAttempts int
Résultat void

CopyDirectory() public méthode

public CopyDirectory ( string sourceDirectory, string targetDirectory, int overwriteFileRetryAttempts = 3 ) : void
sourceDirectory string
targetDirectory string
overwriteFileRetryAttempts int
Résultat void

CopyFile() public méthode

public CopyFile ( string sourceFile, string targetFile, int overwriteFileRetryAttempts = 3 ) : ReplaceStatus
sourceFile string
targetFile string
overwriteFileRetryAttempts int
Résultat ReplaceStatus

CreateTemporaryDirectory() public méthode

public CreateTemporaryDirectory ( ) : string
Résultat string

CreateTemporaryFile() public méthode

public CreateTemporaryFile ( string extension, string &path ) : Stream
extension string
path string
Résultat Stream

DeleteDirectory() public méthode

public DeleteDirectory ( string path ) : void
path string
Résultat void

DeleteDirectory() public méthode

public DeleteDirectory ( string path, DeletionOptions options ) : void
path string
options DeletionOptions
Résultat void

DeleteFile() public méthode

public DeleteFile ( string path ) : void
path string
Résultat void

DeleteFile() public méthode

public DeleteFile ( string path, DeletionOptions options ) : void
path string
options DeletionOptions
Résultat void

DirectoryExists() public méthode

public DirectoryExists ( string path ) : bool
path string
Résultat bool

DirectoryIsEmpty() public méthode

public DirectoryIsEmpty ( string path ) : bool
path string
Résultat bool

EnsureDirectoryExists() public méthode

public EnsureDirectoryExists ( string directoryPath ) : void
directoryPath string
Résultat void

EnsureDiskHasEnoughFreeSpace() public méthode

public EnsureDiskHasEnoughFreeSpace ( string directoryPath ) : void
directoryPath string
Résultat void

EnsureDiskHasEnoughFreeSpace() public méthode

public EnsureDiskHasEnoughFreeSpace ( string directoryPath, long requiredSpaceInBytes ) : void
directoryPath string
requiredSpaceInBytes long
Résultat void

EnumerateDirectories() public méthode

public EnumerateDirectories ( string parentDirectoryPath ) : IEnumerable
parentDirectoryPath string
Résultat IEnumerable

EnumerateDirectoriesRecursively() public méthode

public EnumerateDirectoriesRecursively ( string parentDirectoryPath ) : IEnumerable
parentDirectoryPath string
Résultat IEnumerable

EnumerateFiles() public méthode

public EnumerateFiles ( string parentDirectoryPath ) : IEnumerable
parentDirectoryPath string
Résultat IEnumerable

EnumerateFilesRecursively() public méthode

public EnumerateFilesRecursively ( string parentDirectoryPath ) : IEnumerable
parentDirectoryPath string
Résultat IEnumerable

EqualHash() public méthode

public EqualHash ( Stream first, Stream second ) : bool
first Stream
second Stream
Résultat bool

FileExists() public méthode

public FileExists ( string path ) : bool
path string
Résultat bool

GetFileSize() public méthode

public GetFileSize ( string path ) : long
path string
Résultat long

GetFullPath() public méthode

public GetFullPath ( string relativeOrAbsoluteFilePath ) : string
relativeOrAbsoluteFilePath string
Résultat string

MoveFile() public méthode

public MoveFile ( string sourceFile, string destinationFile ) : void
sourceFile string
destinationFile string
Résultat void

OctopusPhysicalFileSystem() public méthode

public OctopusPhysicalFileSystem ( ILogger log ) : System
log ILogger
Résultat System

OpenFile() public méthode

public OpenFile ( string path, FileAccess access, FileShare share ) : Stream
path string
access FileAccess
share FileShare
Résultat Stream

OpenFile() public méthode

public OpenFile ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream
path string
mode FileMode
access FileAccess
share FileShare
Résultat Stream

OverwriteAndDelete() public méthode

public OverwriteAndDelete ( string originalFile, string temporaryReplacement ) : void
originalFile string
temporaryReplacement string
Résultat void

OverwriteFile() public méthode

public OverwriteFile ( string path, string contents ) : void
path string
contents string
Résultat void

ReadAllText() public méthode

public ReadAllText ( string scriptFile ) : string
scriptFile string
Résultat string

ReadFile() public méthode

public ReadFile ( string path ) : string
path string
Résultat string

RemoveInvalidFileNameChars() public méthode

public RemoveInvalidFileNameChars ( string path ) : string
path string
Résultat string

Replace() public méthode

Creates, updates or skips a file based on a file content comparison
Useful for cases where you do not want a file's timestamp to change when overwriting it with identical contents or you want clearer logging as to what changed.
public Replace ( string oldFilePath, Stream newStream, int overwriteFileRetryAttempts = 3 ) : ReplaceStatus
oldFilePath string
newStream Stream
overwriteFileRetryAttempts int
Résultat ReplaceStatus

WriteAllBytes() public méthode

public WriteAllBytes ( string filePath, byte data ) : void
filePath string
data byte
Résultat void