<PackageReference Include="Relativity.Server.Import.SDK" Version="2.9.2" />

IFile

public interface IFile
Represents an abstract wrapper for the File class.
void Copy(string sourceFileName, string destFileName)

Copies an existing file to a new file. Overwriting a file of the same name is not allowed.

void Copy(string sourceFileName, string destFileName, bool overwrite)

Copies an existing file to a new file. Overwriting a file of the same name is allowed.

int CountLinesInFile(string path)

Counts the number of lines in the file specified by the provided path.

FileStream Create(string path)

Creates or overwrites a file in the specified path.

FileStream Create(string path, bool append)

Creates or overwrites a file in the specified path.

FileStream Create(string path, FileMode mode, FileAccess access, FileShare share)

Creates or overwrites a file in the specified path.

StreamWriter CreateText(string path)

Creates or opens a file for writing UTF-8 encoded text.

void Delete(string path)

Deletes the specified file.

bool Exists(string path)

Determines whether the specified file exists.

long GetFileSize(string fileName)

Gets the size of the file.

void Move(string sourceFileName, string destFileName)

Moves a specified file to a new location, providing the option to specify a new file name.

string ReadAllText(string path)

Opens a text file, reads all lines of the file, and then closes the file.

FileStream ReopenAndTruncate(string fileName, long length)

Reopens a file stream and truncates the stream to the specified length.