/// <summary> /// Initializes a new instance of the <see cref="FenrirFileSystem"/> class. /// </summary> public FenrirFileSystem() { DefaultEncoding = Encoding.Unicode; StorageLocal = new FenrirFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); StorageRoaming = new FenrirFolder(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); StorageUser = new FenrirFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); StorageWorking = new FenrirFolder(Environment.CurrentDirectory); }
/// <summary> /// Sets the user's storage folder. /// </summary> /// <param name="path">The path.</param> /// <returns>Whether the folder was set (true) or not (false).</returns> public override bool SetStorageUser(string path) { Exceptions.NotNullOrEmptyCheck(path, nameof(path)); if (Fenrir.FileSystem.FolderExists(path)) { StorageUser = new FenrirFolder(path); return true; } return false; }
/// <summary> /// Copies a folder. /// </summary> /// <param name="folder">The folder.</param> /// <param name="destinationPath">The destination path.</param> /// <param name="destinationName">Name of the destination.</param> /// <param name="folderCollisionOption">The folder collision option.</param> /// <param name="fileCollisionOption">The file collision option.</param> /// <returns>An AFolder representing the file.</returns> public override AFolder CopyFolder(string folder, AFolder destinationPath, string destinationName, FolderCollisionOption folderCollisionOption, FileCollisionOption fileCollisionOption) { Exceptions.NotNullCheck<AFolder>(destinationPath, nameof(destinationPath)); Exceptions.NotNullOrEmptyCheck(Name, nameof(destinationName)); string path = System.IO.Path.Combine(FullPath, folder); if (Fenrir.FileSystem.FolderExists(path)) { AFolder newFolder = new FenrirFolder(path); return newFolder.Copy(destinationPath.FullPath, destinationName, folderCollisionOption, fileCollisionOption); } return null; }