Skip to content

Commit 8a6dde3

Browse files
authored
Merge pull request #14 from SharpGrip/10-mark-non-async-methods-in-ifilesystem-obsolete
mark non async methods as obsolete
2 parents 1af7ad3 + 4e73d3a commit 8a6dde3

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

FileSystem/src/IFileSystem.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23
using System.Threading;
34
using System.Threading.Tasks;
@@ -37,6 +38,7 @@ public interface IFileSystem
3738
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
3839
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
3940
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
41+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
4042
public IFile GetFile(string virtualPath);
4143

4244
/// <summary>
@@ -66,6 +68,7 @@ public interface IFileSystem
6668
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
6769
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
6870
/// <exception cref="DirectoryNotFoundException">Thrown if the directory does not exists at the given path.</exception>
71+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
6972
public IDirectory GetDirectory(string virtualPath);
7073

7174
/// <summary>
@@ -95,6 +98,7 @@ public interface IFileSystem
9598
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
9699
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
97100
/// <exception cref="DirectoryNotFoundException">Thrown if the directory does not exists at the given path.</exception>
101+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
98102
public IEnumerable<IFile> GetFiles(string virtualPath = "");
99103

100104
/// <summary>
@@ -124,6 +128,7 @@ public interface IFileSystem
124128
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
125129
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
126130
/// <exception cref="DirectoryNotFoundException">Thrown if the directory does not exists at the given path.</exception>
131+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
127132
public IEnumerable<IDirectory> GetDirectories(string virtualPath = "");
128133

129134
/// <summary>
@@ -152,6 +157,7 @@ public interface IFileSystem
152157
/// <exception cref="DuplicateAdapterPrefixException">Thrown when multiple adapters are registered with the same prefix.</exception>
153158
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
154159
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
160+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
155161
public bool FileExists(string virtualPath);
156162

157163
/// <summary>
@@ -179,6 +185,7 @@ public interface IFileSystem
179185
/// <exception cref="DuplicateAdapterPrefixException">Thrown when multiple adapters are registered with the same prefix.</exception>
180186
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
181187
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
188+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
182189
public bool DirectoryExists(string virtualPath);
183190

184191
/// <summary>
@@ -206,6 +213,7 @@ public interface IFileSystem
206213
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
207214
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
208215
/// <exception cref="DirectoryExistsException">Thrown if the directory exists at the given path.</exception>
216+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
209217
public void CreateDirectory(string virtualPath);
210218

211219
/// <summary>
@@ -233,6 +241,7 @@ public interface IFileSystem
233241
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
234242
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
235243
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
244+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
236245
public void DeleteFile(string virtualPath);
237246

238247
/// <summary>
@@ -260,6 +269,7 @@ public interface IFileSystem
260269
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
261270
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
262271
/// <exception cref="DirectoryNotFoundException">Thrown if the directory does not exists at the given path.</exception>
272+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
263273
public void DeleteDirectory(string virtualPath);
264274

265275
/// <summary>
@@ -288,6 +298,7 @@ public interface IFileSystem
288298
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
289299
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
290300
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
301+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
291302
public byte[] ReadFile(string virtualPath);
292303

293304
/// <summary>
@@ -317,6 +328,7 @@ public interface IFileSystem
317328
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
318329
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
319330
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
331+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
320332
public string ReadTextFile(string virtualPath);
321333

322334
/// <summary>
@@ -348,6 +360,7 @@ public interface IFileSystem
348360
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
349361
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
350362
/// <exception cref="FileExistsException">Thrown if the file exists at the given path and parameter "overwrite" = false.</exception>
363+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
351364
public void CopyFile(string virtualSourcePath, string virtualDestinationPath, bool overwrite = false);
352365

353366
/// <summary>
@@ -381,6 +394,7 @@ public interface IFileSystem
381394
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
382395
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
383396
/// <exception cref="FileExistsException">Thrown if the file exists at the given path and parameter "overwrite" = false.</exception>
397+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
384398
public void MoveFile(string virtualSourcePath, string virtualDestinationPath, bool overwrite = false);
385399

386400
/// <summary>
@@ -413,6 +427,7 @@ public interface IFileSystem
413427
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
414428
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
415429
/// <exception cref="FileExistsException">Thrown if the file exists at the given path and parameter "overwrite" = false.</exception>
430+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
416431
public void WriteFile(string virtualPath, byte[] contents, bool overwrite = false);
417432

418433
/// <summary>
@@ -444,6 +459,7 @@ public interface IFileSystem
444459
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
445460
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
446461
/// <exception cref="FileExistsException">Thrown if the file exists at the given path and parameter "overwrite" = false.</exception>
462+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
447463
public void WriteFile(string virtualPath, string contents, bool overwrite = false);
448464

449465
/// <summary>
@@ -474,6 +490,7 @@ public interface IFileSystem
474490
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
475491
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
476492
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
493+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
477494
public void AppendFile(string virtualPath, byte[] contents);
478495

479496
/// <summary>
@@ -503,6 +520,7 @@ public interface IFileSystem
503520
/// <exception cref="AdapterNotFoundException">Thrown when an adapter could not be found via the provided prefix.</exception>
504521
/// <exception cref="PrefixNotFoundInPathException">Thrown when a prefix in the provided path could not be found.</exception>
505522
/// <exception cref="FileNotFoundException">Thrown if the file does not exists at the given path.</exception>
523+
[Obsolete("Method is deprecated, please use the async version instead. Method will be removed in v2.0.")]
506524
public void AppendFile(string virtualPath, string contents);
507525

508526
/// <summary>

0 commit comments

Comments
 (0)