Show / Hide Table of Contents

Class FileSystemUtils

Inheritance
object
FileSystemUtils
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public class FileSystemUtils

Constructors

FileSystemUtils()

Declaration
public FileSystemUtils()

Methods

AddToZip(ref ZipOutputStream, string, string, string)

Declaration
[Obsolete("Deprecated in DotNetNuke 9.11.0. Replaced with .NET compression types. Scheduled for removal in v11.0.0.")]
public static void AddToZip(ref ZipOutputStream zipFile, string filePath, string fileName, string folder)
Parameters
Type Name Description
ZipOutputStream zipFile
string filePath
string fileName
string folder

AddToZip(ref ZipArchive, string, string, string)

Declaration
public static void AddToZip(ref ZipArchive zipFile, string filePath, string fileName, string folder)
Parameters
Type Name Description
ZipArchive zipFile
string filePath
string fileName
string folder

AddToZipAsync(ZipArchive, string, string, string, CancellationToken)

Declaration
public static Task AddToZipAsync(ZipArchive zipFile, string filePath, string fileName, string folder, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ZipArchive zipFile
string filePath
string fileName
string folder
CancellationToken cancellationToken
Returns
Type Description
Task

CopyFile(string, string)

Declaration
public static void CopyFile(string sourceFileName, string destFileName)
Parameters
Type Name Description
string sourceFileName
string destFileName

CopyFileAsync(string, string)

Declaration
public static Task CopyFileAsync(string sourceFileName, string destFileName)
Parameters
Type Name Description
string sourceFileName
string destFileName
Returns
Type Description
Task

DeleteEmptyFoldersRecursive(string)

Declaration
public static void DeleteEmptyFoldersRecursive(string path)
Parameters
Type Name Description
string path

DeleteEmptyFoldersRecursiveAsync(string, CancellationToken)

Declaration
public static Task DeleteEmptyFoldersRecursiveAsync(string path, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string path
CancellationToken cancellationToken
Returns
Type Description
Task

DeleteFile(string)

Declaration
public static void DeleteFile(string fileName)
Parameters
Type Name Description
string fileName

DeleteFileAsync(string)

Declaration
public static Task DeleteFileAsync(string fileName)
Parameters
Type Name Description
string fileName
Returns
Type Description
Task

DeleteFileWithWait(string, short, short)

Declaration
public static bool DeleteFileWithWait(string fileName, short waitInMilliseconds, short maxAttempts)
Parameters
Type Name Description
string fileName
short waitInMilliseconds
short maxAttempts
Returns
Type Description
bool

DeleteFileWithWaitAsync(string, short, short, CancellationToken)

Declaration
public static Task<bool> DeleteFileWithWaitAsync(string fileName, short waitInMilliseconds, short maxAttempts, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string fileName
short waitInMilliseconds
short maxAttempts
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

DeleteFiles(IApplicationStatusInfo, Array)

Declaration
public static string DeleteFiles(IApplicationStatusInfo appStatus, Array arrPaths)
Parameters
Type Name Description
IApplicationStatusInfo appStatus
Array arrPaths
Returns
Type Description
string

DeleteFiles(Array)

Declaration
[Obsolete("Deprecated in DotNetNuke 10.0.2. Please use overload with IApplicationStatusInfo. Scheduled removal in v12.0.0.")]
public static string DeleteFiles(Array arrPaths)
Parameters
Type Name Description
Array arrPaths
Returns
Type Description
string

DeleteFilesAsync(IApplicationStatusInfo, Array, CancellationToken)

Declaration
public static Task<string> DeleteFilesAsync(IApplicationStatusInfo appStatus, Array arrPaths, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IApplicationStatusInfo appStatus
Array arrPaths
CancellationToken cancellationToken
Returns
Type Description
Task<string>

DeleteFilesRecursive(string, string)

Declaration
public static void DeleteFilesRecursive(string strRoot, string filter)
Parameters
Type Name Description
string strRoot
string filter

DeleteFilesRecursiveAsync(string, string, CancellationToken)

Declaration
public static Task DeleteFilesRecursiveAsync(string strRoot, string filter, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string strRoot
string filter
CancellationToken cancellationToken
Returns
Type Description
Task

DeleteFolderRecursive(string)

Declaration
public static void DeleteFolderRecursive(string strRoot)
Parameters
Type Name Description
string strRoot

DeleteFolderRecursiveAsync(string, CancellationToken)

Declaration
public static Task DeleteFolderRecursiveAsync(string strRoot, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string strRoot
CancellationToken cancellationToken
Returns
Type Description
Task

FixPath(string)

Declaration
public static string FixPath(string input)
Parameters
Type Name Description
string input
Returns
Type Description
string

ReadFile(string)

Declaration
public static string ReadFile(string filePath)
Parameters
Type Name Description
string filePath
Returns
Type Description
string

ReadFileAsync(string, CancellationToken)

Declaration
public static Task<string> ReadFileAsync(string filePath, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filePath
CancellationToken cancellationToken
Returns
Type Description
Task<string>

UnzipResources(ZipInputStream, string)

Declaration
[Obsolete("Deprecated in DotNetNuke 9.11.0. Replaced with .NET compression types. Scheduled for removal in v11.0.0.")]
public static void UnzipResources(ZipInputStream zipStream, string destPath)
Parameters
Type Name Description
ZipInputStream zipStream
string destPath

UnzipResources(IEnumerable<ZipArchiveEntry>, string)

Declaration
public static void UnzipResources(IEnumerable<ZipArchiveEntry> zipArchiveEntries, string destPath)
Parameters
Type Name Description
IEnumerable<ZipArchiveEntry> zipArchiveEntries
string destPath

UnzipResources(ZipArchive, string)

Declaration
public static void UnzipResources(ZipArchive zipStream, string destPath)
Parameters
Type Name Description
ZipArchive zipStream
string destPath

UnzipResourcesAsync(IEnumerable<ZipArchiveEntry>, string, CancellationToken)

Declaration
public static Task UnzipResourcesAsync(IEnumerable<ZipArchiveEntry> zipArchiveEntries, string destPath, CancellationToken cancellationToken)
Parameters
Type Name Description
IEnumerable<ZipArchiveEntry> zipArchiveEntries
string destPath
CancellationToken cancellationToken
Returns
Type Description
Task

UnzipResourcesAsync(ZipArchive, string, CancellationToken)

Declaration
public static Task UnzipResourcesAsync(ZipArchive zipStream, string destPath, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ZipArchive zipStream
string destPath
CancellationToken cancellationToken
Returns
Type Description
Task

Extension Methods

JsonExtensionsWeb.ToJson(object)
Back to top by the community, for the community... #DNNCMS