1+ using System . Collections . Generic ;
2+ using System . Security . AccessControl ;
3+ using System . Text ;
4+
5+ namespace System . IO . Abstractions
6+ {
7+ public interface IFile
8+ {
9+ IFileSystem FileSystem { get ; }
10+
11+ void AppendAllLines ( string path , IEnumerable < string > contents ) ;
12+ void AppendAllLines ( string path , IEnumerable < string > contents , Encoding encoding ) ;
13+ void AppendAllText ( string path , string contents ) ;
14+ void AppendAllText ( string path , string contents , Encoding encoding ) ;
15+ StreamWriter AppendText ( string path ) ;
16+ void Copy ( string sourceFileName , string destFileName ) ;
17+ void Copy ( string sourceFileName , string destFileName , bool overwrite ) ;
18+ Stream Create ( string path ) ;
19+ Stream Create ( string path , int bufferSize ) ;
20+ Stream Create ( string path , int bufferSize , FileOptions options ) ;
21+ StreamWriter CreateText ( string path ) ;
22+ void Delete ( string path ) ;
23+ bool Exists ( string path ) ;
24+ FileSecurity GetAccessControl ( string path ) ;
25+ FileSecurity GetAccessControl ( string path , AccessControlSections includeSections ) ;
26+ FileAttributes GetAttributes ( string path ) ;
27+ DateTime GetCreationTime ( string path ) ;
28+ DateTime GetCreationTimeUtc ( string path ) ;
29+ DateTime GetLastAccessTime ( string path ) ;
30+ DateTime GetLastAccessTimeUtc ( string path ) ;
31+ DateTime GetLastWriteTime ( string path ) ;
32+ DateTime GetLastWriteTimeUtc ( string path ) ;
33+ void Move ( string sourceFileName , string destFileName ) ;
34+ Stream Open ( string path , FileMode mode ) ;
35+ Stream Open ( string path , FileMode mode , FileAccess access ) ;
36+ Stream Open ( string path , FileMode mode , FileAccess access , FileShare share ) ;
37+ Stream OpenRead ( string path ) ;
38+ StreamReader OpenText ( string path ) ;
39+ Stream OpenWrite ( string path ) ;
40+ byte [ ] ReadAllBytes ( string path ) ;
41+ string [ ] ReadAllLines ( string path ) ;
42+ string [ ] ReadAllLines ( string path , Encoding encoding ) ;
43+ string ReadAllText ( string path ) ;
44+ string ReadAllText ( string path , Encoding encoding ) ;
45+ IEnumerable < string > ReadLines ( string path ) ;
46+ IEnumerable < string > ReadLines ( string path , Encoding encoding ) ;
47+ void SetAccessControl ( string path , FileSecurity fileSecurity ) ;
48+ void SetAttributes ( string path , FileAttributes fileAttributes ) ;
49+ void SetCreationTime ( string path , DateTime creationTime ) ;
50+ void SetCreationTimeUtc ( string path , DateTime creationTimeUtc ) ;
51+ void SetLastAccessTime ( string path , DateTime lastAccessTime ) ;
52+ void SetLastAccessTimeUtc ( string path , DateTime lastAccessTimeUtc ) ;
53+ void SetLastWriteTime ( string path , DateTime lastWriteTime ) ;
54+ void SetLastWriteTimeUtc ( string path , DateTime lastWriteTimeUtc ) ;
55+ void WriteAllBytes ( string path , byte [ ] bytes ) ;
56+ void WriteAllLines ( string path , IEnumerable < string > contents ) ;
57+ void WriteAllLines ( string path , IEnumerable < string > contents , Encoding encoding ) ;
58+ void WriteAllLines ( string path , string [ ] contents ) ;
59+ void WriteAllLines ( string path , string [ ] contents , Encoding encoding ) ;
60+ void WriteAllText ( string path , string contents ) ;
61+ void WriteAllText ( string path , string contents , Encoding encoding ) ;
62+
63+ #if NET40
64+ void Decrypt ( string path ) ;
65+ void Encrypt ( string path ) ;
66+ void Replace ( string sourceFileName , string destinationFileName , string destinationBackupFileName ) ;
67+ void Replace ( string sourceFileName , string destinationFileName , string destinationBackupFileName , bool ignoreMetadataErrors ) ;
68+ #endif
69+ }
70+ }
0 commit comments