public static void CheckOverwrite(string filePath, bool overwrite) { if (!overwrite && File.Exists(filePath)) { var exception = CommonFileSystem.GetCannotOverwriteFileIOException(filePath); throw exception; } }
public static IOException GetCannotOverwriteFileIOException(this IFileSystemOperator fileSystemOperator, string filePath) { var output = CommonFileSystem.GetCannotOverwriteFileIOException(filePath); return(output); }