Table of Contents

Class ZipDirectory

Namespace
CMS.IO.Zip
Assembly
CMS.IO.dll

Envelope for System.IO.Directory.

public sealed class ZipDirectory : AbstractDirectory
Inheritance
object
ZipDirectory
Extension Methods

Constructors

ZipDirectory(ZipStorageProvider)

Constructor.

public ZipDirectory(ZipStorageProvider provider)

Parameters

provider ZipStorageProvider

Parent provider

Methods

CreateDirectory(string)

Creates all directories and subdirectories as specified by path.

public override DirectoryInfo CreateDirectory(string path)

Parameters

path string

Path to create

Returns

DirectoryInfo

Delete(string)

Deletes an empty directory.

public override void Delete(string path)

Parameters

path string

Path to directory

Delete(string, bool)

Deletes an empty directory and, if indicated, any subdirectories and files in the directory.

public override void Delete(string path, bool recursive)

Parameters

path string

Path to directory

recursive bool

If delete if subdirs exists

DeleteDirectoryStructure(string)

Deletes all files in the directory structure. It works also in a shared hosting environment.

public override void DeleteDirectoryStructure(string path)

Parameters

path string

Full path of the directory to delete

EnumerateDirectories(string)

Returns an enumerable collection of directory names in a specified path.

public override IEnumerable<string> EnumerateDirectories(string path)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

Returns

IEnumerable<string>

An enumerable collection of the full names (including paths) for the directories in the directory specified by path.

Remarks

This method is identical to EnumerateDirectories(string, string) with the asterisk (*) specified as the search pattern, so it returns all subdirectories.

EnumerateDirectories(string, string)

Returns an enumerable collection of directory names that match a search pattern in a specified path.

public override IEnumerable<string> EnumerateDirectories(string path, string searchPattern)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

searchPattern string

Search pattern.

Returns

IEnumerable<string>

An enumerable collection of the full names (including paths) for the directories in the directory specified by path and that match the specified search pattern.

EnumerateDirectories(string, string, SearchOption)

Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories.

public override IEnumerable<string> EnumerateDirectories(string path, string searchPattern, SearchOption searchOption)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

searchPattern string

Search pattern.

searchOption SearchOption

One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories.

Returns

IEnumerable<string>

An enumerable collection of the full names (including paths) for the directories in the directory specified by path and that match the specified search pattern and option.

EnumerateFiles(string)

Returns an enumerable collection of file names in a specified path.

public override IEnumerable<string> EnumerateFiles(string path)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

Returns

IEnumerable<string>

An enumerable collection of the full names (including paths) for the files in the directory specified by path.

EnumerateFiles(string, string)

Returns an enumerable collection of file names that match a search pattern in a specified path.

public override IEnumerable<string> EnumerateFiles(string path, string searchPattern)

Parameters

path string

The relative or absolute path to the directory to search. This string is not case-sensitive.

searchPattern string

Search pattern.

Returns

IEnumerable<string>

An enumerable collection of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern.

Exists(string)

Determines whether the given path refers to an existing directory on disk.

public override bool Exists(string path)

Parameters

path string

Path to test

Returns

bool

GetDirectories(string)

Gets the names of subdirectories in the specified directory.

public override string[] GetDirectories(string path)

Parameters

path string

Path to retrieve directories from

Returns

string[]

GetDirectories(string, string)

Returns the names of files (including their paths) in the specified directory.

public override string[] GetDirectories(string path, string searchPattern)

Parameters

path string

Path to directory

searchPattern string

Search pattern

Returns

string[]

GetDirectories(string, string, SearchOption)

Gets the names of the subdirectories (including their paths) that match the specified search pattern in the current directory, and optionally searches subdirectories.

public override string[] GetDirectories(string path, string searchPattern, SearchOption searchOption)

Parameters

path string

Path to directory

searchPattern string

Search pattern

searchOption SearchOption

Specifies whether to search the current directory, or the current directory and all subdirectories.

Returns

string[]

GetFiles(string)

Returns the names of files (including their paths) in the specified directory.

public override string[] GetFiles(string path)

Parameters

path string

Path to retrieve files from

Returns

string[]

GetFiles(string, string)

Returns the names of files (including their paths) in the specified directory.

public override string[] GetFiles(string path, string searchPattern)

Parameters

path string

Path to retrieve files from

searchPattern string

Search pattern

Returns

string[]

Move(string, string)

Moves a file or a directory and its contents to a new location.

public override void Move(string sourceDirName, string destDirName)

Parameters

sourceDirName string

Source directory name

destDirName string

Destination directory name

PrepareFilesForImport(string)

Prepares files for import. Converts them to media library.

[Obsolete("Method was not intended for public use and will be removed in the next version.")]
[ObsoleteSince(28, 1)]
public override void PrepareFilesForImport(string path)

Parameters

path string

Path.