Otter SDK Reference
Version:

FileOperationsExecuter Class

Contains extension methods for IFileOperationsExecuter.

Inheritance Hierarchy

  • object
    • Inedo.Agents.FileOperationsExecuter

Syntax

public class FileOperationsExecuter

Methods

Name Description
AddAttributes(IFileOperationsExecuter agent, string path, System.IO.FileAttributes attributes)

Adds the specified attributes to the specified file.

AddAttributesAsync(IFileOperationsExecuter agent, string path, System.IO.FileAttributes attributes)

Adds the specified attributes to the specified file.

AppendAllText(IFileOperationsExecuter agent, string path, string contents)

Appends all text without using an encoding, see System.Buffer.BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32).

AppendAllText(IFileOperationsExecuter agent, string path, string contents, System.Text.Encoding encoding)

Appends all text.

AppendAllTextAsync(IFileOperationsExecuter agent, string path, string contents)

Appends all text without using an encoding, see System.Buffer.BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32).

AppendAllTextAsync(IFileOperationsExecuter agent, string path, string contents, System.Text.Encoding encoding)

Appends all text.

CanonicalizePath(IFileOperationsExecuter agent, string path)

Returns a path that has some common issues fixed, such as extra directory separator characters or incorrect directory separator characters.

ClearDirectory(IFileOperationsExecuter agent, string path)

Deletes all files and subfolders in a folder (but not the folder itself).

CombinePath(IFileOperationsExecuter agent, string[] paths)

Combines multiple path components into one string.

CopyFile(IFileOperationsExecuter agent, string sourcePath, string targetPath, bool overwrite)

Copies the file from sourcePath to targetPath.

CreateDirectory(IFileOperationsExecuter agent, string path)

Ensures that the directory with the specified path exists.

CreateZipFile(IFileOperationsExecuter agent, string sourcePath, string targetFileName)

Creates a zip file from the specified directory.

DeleteDirectories(IFileOperationsExecuter agent, string[] directoryNames)

Deletes all of the specified directories if they exist.

DeleteDirectory(IFileOperationsExecuter agent, string dirName)

Deletes the specified directory if it exists.

DeleteDirectoryAsync(IFileOperationsExecuter agent, string dirName)

Deletes the specified directory if it exists.

DeleteFile(IFileOperationsExecuter agent, string fileName)

Deletes the specified file if it exists.

DeleteFileAsync(IFileOperationsExecuter agent, string fileName)

Deletes the specified file if it exists.

DeleteFiles(IFileOperationsExecuter agent, string[] fileNames)

Deletes all of the specified files if they exist.

DirectoryExists(IFileOperationsExecuter agent, string path)

Returns a value indicating whether a directory exists at the specified path.

ExtractZipFile(IFileOperationsExecuter agent, string sourceFileName, string targetPath, bool overwrite)

Extracts a zip file into the specified directory.

FileCopyBatch(IFileOperationsExecuter agent, string sourceDirName, string[] sourceFileNames, string destDirName, string[] destFileNames, bool overwrite, bool createDirectory)

Performs a local copy on a batch of files.

FileExists(IFileOperationsExecuter agent, string path)

Returns a value indicating whether a file exists at the specified path.

GetAttributes(IFileOperationsExecuter agent, string path)

Returns the attributes of the specified file.

GetBaseWorkingDirectory(IFileOperationsExecuter agent)

Returns the base working directory for the agent.

GetDirectoryInfo(IFileOperationsExecuter agent, string path)

Returns information about the directory at the specified path.

GetFileInfo(IFileOperationsExecuter agent, string path)

Returns information about the file at the specified path.

GetFileSystemInfos(IFileOperationsExecuter agent, string path, Inedo.IO.MaskingContext mask)

Returns files and directories which match the specified mask.

MoveDirectory(IFileOperationsExecuter agent, string sourceDirName, string destDirName)

Moves a directory from sourceDirName to destDirName.

MoveFile(IFileOperationsExecuter agent, string sourceFileName, string targetFileName, bool overwrite)

Moves a file from sourceFileName to targetFileName.

OpenFile(IFileOperationsExecuter agent, string path, System.IO.FileMode fileMode, System.IO.FileAccess fileAccess)

Opens a file on the agent.

ReadAllLines(IFileOperationsExecuter agent, string path)

Reads all lines without using an encoding, see System.Buffer.BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32).

ReadAllLines(IFileOperationsExecuter agent, string path, System.Text.Encoding encoding)

Reads all lines.

ReadAllLinesAsync(IFileOperationsExecuter agent, string path)

Reads all lines.

ReadAllLinesAsync(IFileOperationsExecuter agent, string path, System.Text.Encoding encoding)

Reads all lines.

ReadAllText(IFileOperationsExecuter agent, string path)

Reads all text.

ReadAllText(IFileOperationsExecuter agent, string path, System.Text.Encoding encoding)

Reads all text.

ReadAllTextAsync(IFileOperationsExecuter agent, string path)

Reads all text.

ReadAllTextAsync(IFileOperationsExecuter agent, string path, System.Text.Encoding encoding)

Reads all text.

ReadFileBytes(IFileOperationsExecuter agent, string path)

Reads all file bytes.

ReadFileBytesAsync(IFileOperationsExecuter agent, string path)

Reads all file bytes.

RemoveAttributes(IFileOperationsExecuter agent, string path, System.IO.FileAttributes attributes)

Removes the specified attributes from the specified file.

RemoveAttributesAsync(IFileOperationsExecuter agent, string path, System.IO.FileAttributes attributes)

Removes the specified attributes from the specified file.

SetAttributes(IFileOperationsExecuter agent, string path, System.IO.FileAttributes fileAttributes)

Writes the specified metadata to the file or directory.

SetLastWriteTime(IFileOperationsExecuter agent, string path, System.DateTime lastModified)

Writes the specified metadata to the file or directory.

WriteAllText(IFileOperationsExecuter agent, string path, string contents)

Writes all text without using an encoding, see System.Buffer.BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32).

WriteAllText(IFileOperationsExecuter agent, string path, string contents, System.Text.Encoding encoding)

Writes all text.

WriteAllTextAsync(IFileOperationsExecuter agent, string path, string contents)

Writes all text without using an encoding, see System.Buffer.BlockCopy(System.Array,System.Int32,System.Array,System.Int32,System.Int32).

WriteAllTextAsync(IFileOperationsExecuter agent, string path, string contents, System.Text.Encoding encoding)

Writes all text.

WriteFileBytes(IFileOperationsExecuter agent, string path, byte[] bytes)

Writes the file bytes.

WriteFileBytesAsync(IFileOperationsExecuter agent, string path, byte[] bytes)

Writes the file bytes.