Method | Description | |
---|---|---|
CopyFile ( string sourcePath, string destinationPath ) : void |
Creates the destination folder if it does not exist. Overwrites the destination file if it already exists.
|
|
CopyFolder ( string src, string dest, bool overwriteExistingFiles ) : void |
Recursively copies the contents of the specified source directory to the specified destination directory. Creates the destination directory if it doesn't already exist. Does not overwrite anything in the destination folder if it already exists.
|
|
DeleteFile ( string path ) : void |
Deletes the file at the given path, or does nothing if it does not exist. Supports deletion of partially or fully read-only files.
|
|
DeleteFolder ( string path ) : void |
Deletes the specified directory and its contents, if the directory exists. Supports deletion of partially or fully read-only directories.
|
|
DownloadFile ( string url, string destinationPath, |
Creates the destination path if it does not exist, and downloads the file to that destination path. Credentials can be null.
|
|
ExecuteWithTempFileStream ( Action |
Executes the specified method with a stream for a temporary file. The file will be deleted after the method executes.
|
|
ExecuteWithTempFolder ( Action |
||
GetFileNamesInFolder ( string folderPath, string searchPattern = "*" ) : IEnumerable |
Gets a list of file names (not including path) in the specified folder, ordered by modified date descending, that match the specified search pattern. Does not include files in subfolders. If the folder does not exist, returns an empty collection.
|
|
GetFilePathsInFolder ( string folderPath, string searchPattern = "*", SearchOption searchOption = SearchOption.TopDirectoryOnly ) : IEnumerable |
Gets a list of file paths in the specified folder, ordered by last modified date descending, that match the specified search pattern. The default search option is to not include files in subfolders. If the folder does not exist, returns an empty collection.
|
|
GetFileStreamForWrite ( string filePath ) : |
Returns a file stream for writing a new file or overwriting an existing file. Automatically creates any folders needed in the given path, if necessary. We recommend passing an absolute path. If a relative path is passed, the working folder is used as the root path. Caller is responsible for properly disposing the stream.
|
|
GetFolderNamesInFolder ( string folderPath ) : List |
Gets a list of folder names in the specified folder.
|
|
GetFolderSize ( string path ) : long |
Gets the sum size, in bytes, of everything in the folder at the given path (recursive).
|
|
GetTextWriterForWrite ( string filePath ) : |
Returns a text writer for writing a new file or overwriting an existing file. Automatically creates any folders needed in the given path, if necessary. We recommend passing an absolute path. If a relative path is passed, the working folder is used as the root path. Caller is responsible for properly disposing the stream.
|
|
MoveFile ( string sourcePath, string destinationPath ) : void |
Overwrites the destination path.
|
|
RecursivelyRemoveReadOnlyAttributeFromItem ( string path ) : void |
Recursively removes the read-only attribute from the specified file or folder.
|
Method | Description | |
---|---|---|
CopyStream ( Stream sourceStream, Stream destinationStream, int bufferSize = 65536 ) : void | ||
handleFailedDeletion ( string path, int &numberOfFailures, |
public static CopyFile ( string sourcePath, string destinationPath ) : void | ||
sourcePath | string | |
destinationPath | string | |
return | void |
public static CopyFolder ( string src, string dest, bool overwriteExistingFiles ) : void | ||
src | string | |
dest | string | |
overwriteExistingFiles | bool | |
return | void |
public static DeleteFile ( string path ) : void | ||
path | string | |
return | void |
public static DeleteFolder ( string path ) : void | ||
path | string | |
return | void |
public static DownloadFile ( string url, string destinationPath, |
||
url | string | |
destinationPath | string | |
credentials | ||
return | void |
public static ExecuteWithTempFileStream ( Action |
||
method | Action |
|
return | void |
public static ExecuteWithTempFolder ( Action |
||
method | Action |
|
return | void |
public static GetFileNamesInFolder ( string folderPath, string searchPattern = "*" ) : IEnumerable |
||
folderPath | string | |
searchPattern | string | |
return | IEnumerable |
public static GetFilePathsInFolder ( string folderPath, string searchPattern = "*", SearchOption searchOption = SearchOption.TopDirectoryOnly ) : IEnumerable |
||
folderPath | string | |
searchPattern | string | |
searchOption | SearchOption | |
return | IEnumerable |
public static GetFileStreamForWrite ( string filePath ) : |
||
filePath | string | |
return |
public static GetFolderNamesInFolder ( string folderPath ) : List |
||
folderPath | string | |
return | List |
public static GetFolderSize ( string path ) : long | ||
path | string | |
return | long |
public static GetTextWriterForWrite ( string filePath ) : |
||
filePath | string | |
return |
public static MoveFile ( string sourcePath, string destinationPath ) : void | ||
sourcePath | string | |
destinationPath | string | |
return | void |
public static RecursivelyRemoveReadOnlyAttributeFromItem ( string path ) : void | ||
path | string | |
return | void |