2020-01-29 10:07:28 +01:00
|
|
|
|
/*
|
2022-01-21 16:33:52 +01:00
|
|
|
|
* Copyright (c) 2022 ETH Zürich, Educational Development and Technology (LET)
|
2020-01-29 10:07:28 +01:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.SystemComponents.Contracts
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides access to file system operations.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IFileSystem
|
|
|
|
|
{
|
2020-08-27 20:10:15 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates all directories and subdirectories defined by the given path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void CreateDirectory(string path);
|
|
|
|
|
|
2020-01-29 10:07:28 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes the item at the given path, if it exists. Directories will be completely deleted, including all subdirectories and files.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Delete(string path);
|
2021-03-17 00:05:29 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the given content as a file under the specified path. If the file doesn't yet exist, it will be created, otherwise overwritten.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Save(string content, string path);
|
2020-01-29 10:07:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|