Class Directory
- Namespace
- Kentico.Xperience.AmazonStorage
- Assembly
- Kentico.Xperience.AmazonStorage.dll
Implementation of Directory class for Amazon S3.
public class Directory : AbstractDirectory
- Inheritance
-
objectDirectory
- Inherited Members
- Extension Methods
Constructors
Directory()
Initializes a new instance of the Directory class, which provides operations with directories.
public Directory()
Methods
CreateDirectory(string)
Creates all directories and subdirectories as specified by path.
public override DirectoryInfo CreateDirectory(string path)
Parameters
path
stringPath to create.
Returns
CreateDiskDirectoryStructure(string)
Creates directory structure on disk for given path.
[Obsolete("Method not intended for public use")]
[ObsoleteSince(28, 2)]
public static void CreateDiskDirectoryStructure(string path)
Parameters
path
stringPath with temporary file.
Delete(string)
Deletes an empty directory.
public override void Delete(string path)
Parameters
path
stringPath 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
stringPath to directory
recursive
boolDeletes all sub directories in given path.
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
stringFull path of the directory to delete
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
stringThe relative or absolute path to the directory to search. This string is not case-sensitive.
searchPattern
stringSearch pattern.
searchOption
SearchOptionOne 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, 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
stringThe relative or absolute path to the directory to search. This string is not case-sensitive.
searchPattern
stringSearch 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
stringPath to test.
Returns
- bool
ExistsInFileSystem(string)
Determines whether the given path refers to an existing directory on file system
public static bool ExistsInFileSystem(string path)
Parameters
path
stringPath to test.
Returns
- bool
ExistsInS3Storage(string)
Determines whether the given path refers to an existing directory on Amazon S3 storage.
public static bool ExistsInS3Storage(string path)
Parameters
path
stringPath to test.
Returns
- bool
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
stringThe relative or absolute path to the directory to search. This string is not case-sensitive.
searchPattern
stringSearch pattern.
searchOption
SearchOptionOne of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory.
Returns
- string[]
An array of the full names (including paths) of the subdirectories that match the specified criteria, or an empty array if no directories are found.
GetFiles(string, string)
Returns the names of files (including their paths) that match the specified search pattern in the specified directory.
public override string[] GetFiles(string path, string searchPattern)
Parameters
path
stringThe relative or absolute path to the directory to search. This string is not case-sensitive.
searchPattern
stringSearch pattern.
Returns
- string[]
An array of the full names (including paths) for the files in the specified directory that match the specified search pattern, or an empty array if no files are found.
Move(string, string)
Moves directory.
public override void Move(string sourceDirName, string destDirName)
Parameters
sourceDirName
stringSource directory name.
destDirName
stringDestination directory name.
PrepareFilesForImport(string)
Prepares files for import. Converts them to lower case.
[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
stringPath.