Tests for IStorageProvider FileExists() and FolderExists()

--HG--
branch : 1.x
extra : rebase_source : aa49eb8dcb103d8ebd1326197062c81df2b11f44
This commit is contained in:
piedone@pyrocenter.hu
2011-12-14 23:46:36 +01:00
parent 1350e5143f
commit e7910da0ad

View File

@@ -64,6 +64,15 @@ namespace Orchard.FileSystems.Media {
#region Implementation of IStorageProvider
/// <summary>
/// Checks if the given file exists within the storage provider.
/// </summary>
/// <param name="path">The relative path within the storage provider.</param>
/// <returns>True if the file exists; False otherwise.</returns>
public bool FileExists(string path) {
return new FileInfo(MapStorage(path)).Exists;
}
/// <summary>
/// Retrieves the public URL for a given file within the storage provider.
/// </summary>
@@ -106,6 +115,15 @@ namespace Orchard.FileSystems.Media {
.ToList();
}
/// <summary>
/// Checks if the given folder exists within the storage provider.
/// </summary>
/// <param name="path">The relative path within the storage provider.</param>
/// <returns>True if the folder exists; False otherwise.</returns>
public bool FolderExists(string path) {
return new DirectoryInfo(MapStorage(path)).Exists;
}
/// <summary>
/// Lists the folders within a storage provider's path.
/// </summary>