C# Класс Bari.Core.Test.Helper.TestFileSystemDirectory

Наследование: IFileSystemDirectory
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CopyFile ( string name, IFileSystemDirectory target, string targetName ) : void
CreateBinaryFile ( string name ) : Stream

Creates a new binary file in this directory

CreateDirectory ( string name ) : IFileSystemDirectory

Creates a child directory if it does not exist yet

CreateTextFile ( string name ) : TextWriter

Creates a new text file with a text writer in this directory

Delete ( ) : void

Deletes the directory

Delete ( bool>.Func filter ) : void

Partially deletes the directory, based on a filter function

DeleteDirectory ( string name ) : void

Deletes a child directory

DeleteFile ( string name ) : void

Deletes a file from this directory

Exists ( string relativePath ) : bool

Checks whether a file exists at the given relative path

GetChildDirectory ( string childName ) : IFileSystemDirectory

Gets interface for a given child directory

GetFileSize ( string relativePath ) : long

Gets the size of the given file which lies in this directory subtree

GetLastModifiedDate ( string relativePath ) : System.DateTime

Gets the last modification's date for a given file which lies in this directory subtree

GetRelativePath ( IFileSystemDirectory childDirectory ) : string

Gets the relative path from this directory to another directory (in any depth)

If the given argument is not a child of this directory, an ArgumentExceptionwill be thrown.

InvalidateCacheFileData ( ) : void
ReadBinaryFile ( string relativePath ) : Stream

Reads an existing binary file which lies in this directory subtree

ReadTextFile ( string relativePath ) : TextReader

Reads an existing text file which lies in this directory subtree

Remake ( ) : void
SetDate ( string name, System.DateTime newDate ) : void
SetFileContents ( string name, string contents ) : void
SetFileSize ( string name, long newSize ) : void
TestFileSystemDirectory ( string name ) : System

Описание методов

CopyFile() публичный Метод

public CopyFile ( string name, IFileSystemDirectory target, string targetName ) : void
name string
target IFileSystemDirectory
targetName string
Результат void

CreateBinaryFile() публичный Метод

Creates a new binary file in this directory
public CreateBinaryFile ( string name ) : Stream
name string Name of the new file
Результат Stream

CreateDirectory() публичный Метод

Creates a child directory if it does not exist yet
public CreateDirectory ( string name ) : IFileSystemDirectory
name string Name of the child directory
Результат IFileSystemDirectory

CreateTextFile() публичный Метод

Creates a new text file with a text writer in this directory
public CreateTextFile ( string name ) : TextWriter
name string Name of the new file
Результат System.IO.TextWriter

Delete() публичный Метод

Deletes the directory
public Delete ( ) : void
Результат void

Delete() публичный Метод

Partially deletes the directory, based on a filter function
public Delete ( bool>.Func filter ) : void
filter bool>.Func Filter function, a relative path, and if it returns true, the file/directory is going to be deleted
Результат void

DeleteDirectory() публичный Метод

Deletes a child directory
public DeleteDirectory ( string name ) : void
name string Name of the directory
Результат void

DeleteFile() публичный Метод

Deletes a file from this directory
public DeleteFile ( string name ) : void
name string Name of the file
Результат void

Exists() публичный Метод

Checks whether a file exists at the given relative path
public Exists ( string relativePath ) : bool
relativePath string Path to the file to check, relative to this directory
Результат bool

GetChildDirectory() публичный Метод

Gets interface for a given child directory
public GetChildDirectory ( string childName ) : IFileSystemDirectory
childName string Name of the child directory
Результат IFileSystemDirectory

GetFileSize() публичный Метод

Gets the size of the given file which lies in this directory subtree
If the file does not exist.
public GetFileSize ( string relativePath ) : long
relativePath string The relative path to the file from this directory
Результат long

GetLastModifiedDate() публичный Метод

Gets the last modification's date for a given file which lies in this directory subtree
If the file does not exist.
public GetLastModifiedDate ( string relativePath ) : System.DateTime
relativePath string The relative path to the file from this directory
Результат System.DateTime

GetRelativePath() публичный Метод

Gets the relative path from this directory to another directory (in any depth)

If the given argument is not a child of this directory, an ArgumentExceptionwill be thrown.

public GetRelativePath ( IFileSystemDirectory childDirectory ) : string
childDirectory IFileSystemDirectory The child directory to get path to
Результат string

InvalidateCacheFileData() публичный Метод

public InvalidateCacheFileData ( ) : void
Результат void

ReadBinaryFile() публичный Метод

Reads an existing binary file which lies in this directory subtree
If the file does not exist.
public ReadBinaryFile ( string relativePath ) : Stream
relativePath string The relative path to the file from this directory
Результат Stream

ReadTextFile() публичный Метод

Reads an existing text file which lies in this directory subtree
If the file does not exist.
public ReadTextFile ( string relativePath ) : TextReader
relativePath string The relative path to the file from this directory
Результат TextReader

Remake() публичный Метод

public Remake ( ) : void
Результат void

SetDate() публичный Метод

public SetDate ( string name, System.DateTime newDate ) : void
name string
newDate System.DateTime
Результат void

SetFileContents() публичный Метод

public SetFileContents ( string name, string contents ) : void
name string
contents string
Результат void

SetFileSize() публичный Метод

public SetFileSize ( string name, long newSize ) : void
name string
newSize long
Результат void

TestFileSystemDirectory() публичный Метод

public TestFileSystemDirectory ( string name ) : System
name string
Результат System