C# Класс Objectivity.Test.Automation.Common.Helpers.FilesHelper

Class for handling downloading files
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Separator char

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

Метод Описание
CopyFile ( double waitTime, string oldName, string newName, string workingDirectory ) : string

Copy the file and check if file was copied with given timeout, shorten the name of file if needed be removing "_".

CopyFile ( double waitTime, string oldName, string newName, string oldSubFolder, string newSubFolder ) : string

Copy the file and check if file was copied with given timeout, shorten the name of file if needed be removing "_".

CountFiles ( string folder ) : int

Counts the files.

CountFiles ( string folder, System.IO.FileType type ) : int

Counts the files of given type.

GetAllFiles ( string folder ) : ICollection

Gets all files from folder.

GetAllFiles ( string folder, string postfixFilesName ) : ICollection

Gets all files from folder, use postfixFilesName in search pattern.

GetAllFilesFromAllSubFolders ( string folder ) : ICollection

Gets all files from all sub folders.

GetAllFilesFromAllSubFolders ( string folder, string postfixFilesName ) : ICollection

Gets all files from all sub folders, use postfixFilesName in search pattern.

GetFileByName ( string folder, string fileName ) : FileInfo

Get file by its name in given folder

GetFilesOfGivenType ( string folder, System.IO.FileType type ) : ICollection

Gets the files of given type.

GetFilesOfGivenType ( string folder, System.IO.FileType type, string postfixFilesName ) : ICollection

Gets the files of given type, use postfixFilesName in search pattern.

GetFilesOfGivenTypeFromAllSubFolders ( string folder, System.IO.FileType type ) : ICollection

Gets the files of given type from all sub folders.

GetFilesOfGivenTypeFromAllSubFolders ( string folder, System.IO.FileType type, string postfixFilesName ) : ICollection

Gets the files of given type from all sub folders, use postfixFilesName in search pattern.

GetFolder ( string appConfigValue, string currentFolder ) : string

Gets the folder from app.config as value of given key.

GetLastFile ( string folder ) : FileInfo

Gets the last file.

GetLastFile ( string folder, System.IO.FileType type ) : FileInfo

Gets the last file of given type.

RenameFile ( double waitTime, string oldName, string newName, string subFolder ) : string

Rename the file and check if file was renamed with given timeout, shorten the name of file if needed be removing "_".

RenameFile ( string oldName, string newName, string subFolder, System.IO.FileType type ) : string

Rename the file of given type and check if file was renamed with ShortTimeout, shorten the name of file if needed be removing "_".

ReturnFileExtension ( System.IO.FileType type ) : string

Returns the file extension.

WaitForFile ( double waitTime, int filesNumber, string folder ) : void

Waits for file for given timeout till number of files increase in sub folder.

WaitForFile ( int filesNumber, string folder ) : void

Waits for file with LongTimeout till number of files increase in sub folder.

WaitForFileOfGivenName ( double waitTime, string filesName, string folder ) : void

Waits for file with given name with given timeout.

WaitForFileOfGivenName ( string filesName, string folder ) : void

Waits for file of given name with LongTimeout

WaitForFileOfGivenType ( System.IO.FileType type, double waitTime, int filesNumber, string folder ) : void

Waits for file of given type for given timeout till number of files increase in sub folder.

WaitForFileOfGivenType ( System.IO.FileType type, int filesNumber, string folder ) : void

Waits for file of given type for LongTimeout till number of files increase in sub folder.

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

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

Copy the file and check if file was copied with given timeout, shorten the name of file if needed be removing "_".
public static CopyFile ( double waitTime, string oldName, string newName, string workingDirectory ) : string
waitTime double Timeout for checking if file was removed
oldName string The old name.
newName string The new name.
workingDirectory string The working folder.
Результат string

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

Copy the file and check if file was copied with given timeout, shorten the name of file if needed be removing "_".
public static CopyFile ( double waitTime, string oldName, string newName, string oldSubFolder, string newSubFolder ) : string
waitTime double Timeout for checking if file was removed
oldName string The old name.
newName string The new name.
oldSubFolder string The old subFolder.
newSubFolder string The new subFolder.
Результат string

CountFiles() публичный статический Метод

Counts the files.
public static CountFiles ( string folder ) : int
folder string The folder.
Результат int

CountFiles() публичный статический Метод

Counts the files of given type.
public static CountFiles ( string folder, System.IO.FileType type ) : int
folder string The folder.
type System.IO.FileType The type.
Результат int

GetAllFiles() публичный статический Метод

Gets all files from folder.
public static GetAllFiles ( string folder ) : ICollection
folder string The folder.
Результат ICollection

GetAllFiles() публичный статический Метод

Gets all files from folder, use postfixFilesName in search pattern.
public static GetAllFiles ( string folder, string postfixFilesName ) : ICollection
folder string The folder.
postfixFilesName string Postfix name of files for search pattern.
Результат ICollection

GetAllFilesFromAllSubFolders() публичный статический Метод

Gets all files from all sub folders.
public static GetAllFilesFromAllSubFolders ( string folder ) : ICollection
folder string The folder.
Результат ICollection

GetAllFilesFromAllSubFolders() публичный статический Метод

Gets all files from all sub folders, use postfixFilesName in search pattern.
public static GetAllFilesFromAllSubFolders ( string folder, string postfixFilesName ) : ICollection
folder string The folder.
postfixFilesName string Postfix name of files for search pattern.
Результат ICollection

GetFileByName() публичный статический Метод

Get file by its name in given folder
public static GetFileByName ( string folder, string fileName ) : FileInfo
folder string The folder
fileName string The file name
Результат System.IO.FileInfo

GetFilesOfGivenType() публичный статический Метод

Gets the files of given type.
public static GetFilesOfGivenType ( string folder, System.IO.FileType type ) : ICollection
folder string The folder.
type System.IO.FileType The type.
Результат ICollection

GetFilesOfGivenType() публичный статический Метод

Gets the files of given type, use postfixFilesName in search pattern.
public static GetFilesOfGivenType ( string folder, System.IO.FileType type, string postfixFilesName ) : ICollection
folder string The folder.
type System.IO.FileType The type of files.
postfixFilesName string Postfix name of files for search pattern.
Результат ICollection

GetFilesOfGivenTypeFromAllSubFolders() публичный статический Метод

Gets the files of given type from all sub folders.
public static GetFilesOfGivenTypeFromAllSubFolders ( string folder, System.IO.FileType type ) : ICollection
folder string The folder.
type System.IO.FileType The type of files.
Результат ICollection

GetFilesOfGivenTypeFromAllSubFolders() публичный статический Метод

Gets the files of given type from all sub folders, use postfixFilesName in search pattern.
public static GetFilesOfGivenTypeFromAllSubFolders ( string folder, System.IO.FileType type, string postfixFilesName ) : ICollection
folder string The folder.
type System.IO.FileType The type of files.
postfixFilesName string Postfix name of files for search pattern.
Результат ICollection

GetFolder() публичный статический Метод

Gets the folder from app.config as value of given key.
public static GetFolder ( string appConfigValue, string currentFolder ) : string
appConfigValue string The application configuration value.
currentFolder string Directory where assembly files are located
Результат string

GetLastFile() публичный статический Метод

Gets the last file.
public static GetLastFile ( string folder ) : FileInfo
folder string The folder.
Результат System.IO.FileInfo

GetLastFile() публичный статический Метод

Gets the last file of given type.
public static GetLastFile ( string folder, System.IO.FileType type ) : FileInfo
folder string The folder.
type System.IO.FileType The type of file.
Результат System.IO.FileInfo

RenameFile() публичный статический Метод

Rename the file and check if file was renamed with given timeout, shorten the name of file if needed be removing "_".
public static RenameFile ( double waitTime, string oldName, string newName, string subFolder ) : string
waitTime double Timeout for checking if file was removed
oldName string The old name.
newName string The new name.
subFolder string The subFolder.
Результат string

RenameFile() публичный статический Метод

Rename the file of given type and check if file was renamed with ShortTimeout, shorten the name of file if needed be removing "_".
public static RenameFile ( string oldName, string newName, string subFolder, System.IO.FileType type ) : string
oldName string The old name.
newName string The new name.
subFolder string The subFolder.
type System.IO.FileType The type of file.
Результат string

ReturnFileExtension() публичный статический Метод

Returns the file extension.
public static ReturnFileExtension ( System.IO.FileType type ) : string
type System.IO.FileType The type.
Результат string

WaitForFile() публичный статический Метод

Waits for file for given timeout till number of files increase in sub folder.
public static WaitForFile ( double waitTime, int filesNumber, string folder ) : void
waitTime double Wait timeout
filesNumber int The initial files number.
folder string The folder.
Результат void

WaitForFile() публичный статический Метод

Waits for file with LongTimeout till number of files increase in sub folder.
public static WaitForFile ( int filesNumber, string folder ) : void
filesNumber int The initial files number.
folder string The folder.
Результат void

WaitForFileOfGivenName() публичный статический Метод

Waits for file with given name with given timeout.
public static WaitForFileOfGivenName ( double waitTime, string filesName, string folder ) : void
waitTime double Wait timeout
filesName string Name of the files.
folder string The folder.
Результат void

WaitForFileOfGivenName() публичный статический Метод

Waits for file of given name with LongTimeout
public static WaitForFileOfGivenName ( string filesName, string folder ) : void
filesName string Name of the files.
folder string The folder.
Результат void

WaitForFileOfGivenType() публичный статический Метод

Waits for file of given type for given timeout till number of files increase in sub folder.
public static WaitForFileOfGivenType ( System.IO.FileType type, double waitTime, int filesNumber, string folder ) : void
type System.IO.FileType The type of file.
waitTime double Wait timeout
filesNumber int The initial files number.
folder string The folder.
Результат void

WaitForFileOfGivenType() публичный статический Метод

Waits for file of given type for LongTimeout till number of files increase in sub folder.
public static WaitForFileOfGivenType ( System.IO.FileType type, int filesNumber, string folder ) : void
type System.IO.FileType The type.
filesNumber int The files number.
folder string The folder.
Результат void

Описание свойств

Separator публичное статическое свойство

Directory separator
public static char Separator
Результат char