aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/FileSystem/IFileSystemProvider.cs
blob: 32c795ffc97d2f37fd86bd446aeb192865f8d24f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.FileSystem;
using Tango.FileSystem.Network;
using static System.Environment;

namespace Tango.FSE.Common.FileSystem
{
    /// <summary>
    /// Represents a remote machine PPC file system provider.
    /// </summary>
    public interface IFileSystemProvider
    {
        /// <summary>
        /// Gets or sets a value indicating whether to enable a P2P WebRTC channel for fast transport.
        /// </summary>
        bool EnableWebRTC { get; set; }

        /// <summary>
        /// Gets a value indicating whether the WebRTC channel is available.
        /// </summary>
        bool IsWebRtcAvailable { get; }

        /// <summary>
        /// Gets a folder by the specified path.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns></returns>
        Task<IFileSystemContainer> GetFolder(String path);

        /// <summary>
        /// Gets the specified special folder.
        /// </summary>
        /// <param name="specialFolder">The special folder.</param>
        /// <returns></returns>
        Task<IFileSystemContainer> GetSpecialFolder(SpecialFolder specialFolder);

        /// <summary>
        /// Gets the ThisPC (the root path of the PC).
        /// </summary>
        /// <returns></returns>
        Task<IFileSystemContainer> GetThisPC();

        /// <summary>
        /// Downloads the specified file or folder item.
        /// </summary>
        /// <param name="item">The file or folder.</param>
        /// <param name="localTargetFolderOrFile">The local target folder or file.</param>
        /// <param name="isLocaTargetFile">Indicates whether the localTargetFolder is a file.</param>
        /// <returns></returns>
        Task<FileSystemHandler> Download(FileSystemItem item, String localTargetFolderOrFile, bool isLocaTargetFile = false);

        /// <summary>
        /// Downloads the specified file or folder item.
        /// </summary>
        /// <param name="remotePath">The remote file or folder.</param>
        /// <param name="isRemotePathFile">Indicates whether the remote path is a file.</param>
        /// <param name="localTargetFolderOrFile">The local target folder or file.</param>
        /// <param name="isLocalTargetFile">Indicates whether the localTargetFolder is a file.</param>
        /// <returns></returns>
        Task<FileSystemHandler> Download(String remotePath, bool isRemotePathFile, String localTargetFolderOrFile, bool isLocalTargetFile = false);

        /// <summary>
        /// Uploads the specified local file or folder.
        /// </summary>
        /// <param name="localSourcePath">The local source path.</param>
        /// <param name="remoteFolder">The remote folder.</param>
        /// <returns></returns>
        Task<FileSystemHandler> Upload(String localSourcePath, FileSystemItem remoteFolder);

        /// <summary>
        /// Uploads the specified local file or folder.
        /// </summary>
        /// <param name="localSourcePath">The local source path.</param>
        /// <param name="remotePath">The remote destination path.</param>
        /// <param name="forRemoteUpgrade">Indicates whether this upload operation is performed for a remote upgrade.</param>
        /// <returns></returns>
        /// <exception cref="System.IO.FileNotFoundException">Could not locate the local file or directory to upload.</exception>
        Task<FileSystemHandler> Upload(String localSourcePath, String remotePath, bool forRemoteUpgrade = false);

        /// <summary>
        /// Copies the specified remote file or folder to the specified target remote folder.
        /// </summary>
        /// <param name="source">The remote source file or folder.</param>
        /// <param name="target">The remote target folder.</param>
        /// <returns></returns>
        Task Copy(FileSystemItem source, FileSystemItem target);

        /// <summary>
        /// Moves the specified remote file or folder to the remote target folder.
        /// </summary>
        /// <param name="source">The remote source file or folder.</param>
        /// <param name="target">The remote target folder.</param>
        /// <returns></returns>
        Task Move(FileSystemItem source, FileSystemItem target);

        /// <summary>
        /// Renames the specified file or folder.
        /// </summary>
        /// <param name="source">The remote source file or folder.</param>
        /// <param name="newName">The new name.</param>
        /// <returns></returns>
        Task Rename(FileSystemItem source, String newName);

        /// <summary>
        /// Deletes the specified file or folder.
        /// </summary>
        /// <param name="item">The remote file or folder.</param>
        /// <returns></returns>
        Task Delete(FileSystemItem item);

        /// <summary>
        /// Creates a new folder at the specified remote parent.
        /// </summary>
        /// <param name="parent">The remote parent path.</param>
        /// <param name="folderName">Name of the new folder.</param>
        /// <returns></returns>
        Task<FolderItem> CreateFolder(FileSystemItem parent, String folderName);

        /// <summary>
        /// Performs a disk space optimization.
        /// </summary>
        /// <returns></returns>
        Task<PerformDiskSpaceOptimizationResponse> PerformDiskSpaceOptimization();
    }
}