22using System ;
33using System . Text ;
44
5- namespace TagBites . IO . Ftp
5+ namespace TagBites . IO . Ftp ;
6+
7+ /// <summary>
8+ /// Exposes static method for creating ftp file system.
9+ /// </summary>
10+ public static class FtpFileSystem
611{
712 /// <summary>
8- /// Exposes static method for creating ftp file system.
13+ /// Creates a Ftp file system.
914 /// </summary>
10- public static class FtpFileSystem
15+ /// <param name="address">The ftp host address.</param>
16+ /// <param name="username">The user name.</param>
17+ /// <param name="password">The password.</param>
18+ /// <param name="encoding">The encoding applied to the contents of files.</param>
19+ /// <param name="connectionType">The Ftp Data connection type.</param>
20+ /// <returns>A Ftp file system contains the procedures that are used to perform file and directory operations.</returns>
21+ public static FileSystem Create ( string address , string username , string password , Encoding encoding = null , FtpDataConnectionType connectionType = FtpDataConnectionType . AutoPassive )
1122 {
12- /// <summary>
13- /// Creates a Ftp file system.
14- /// </summary>
15- /// <param name="address">The ftp host address.</param>
16- /// <param name="username">The user name.</param>
17- /// <param name="password">The password.</param>
18- /// <param name="encoding">The encoding applied to the contents of files.</param>
19- /// <param name="connectionType">The Ftp Data connection type.</param>
20- /// <returns>A Ftp file system contains the procedures that are used to perform file and directory operations.</returns>
21- public static FileSystem Create ( string address , string username , string password , Encoding encoding = null , FtpDataConnectionType connectionType = FtpDataConnectionType . AutoPassive )
23+ var connectionConfig = new FtpConnectionConfig ( address , username , password )
2224 {
23- var connectionConfig = new FtpConnectionConfig ( address , username , password )
24- {
25- DataConnectionType = connectionType ,
26- Encoding = encoding
27- } ;
28- return new FileSystem ( new FtpFileSystemOperations ( connectionConfig ) ) ;
29- }
25+ DataConnectionType = connectionType ,
26+ Encoding = encoding
27+ } ;
28+ return new FileSystem ( new FtpFileSystemOperations ( connectionConfig ) ) ;
29+ }
3030
31- /// <summary>
32- /// Creates a Ftp file system.
33- /// </summary>
34- /// <param name="connectionConfig">FTP connection config.</param>
35- /// <returns>A Ftp file system contains the procedures that are used to perform file and directory operations.</returns>
36- public static FileSystem Create ( FtpConnectionConfig connectionConfig )
37- {
38- if ( connectionConfig == null )
39- throw new ArgumentNullException ( nameof ( connectionConfig ) ) ;
31+ /// <summary>
32+ /// Creates a Ftp file system.
33+ /// </summary>
34+ /// <param name="connectionConfig">FTP connection config.</param>
35+ /// <returns>A Ftp file system contains the procedures that are used to perform file and directory operations.</returns>
36+ public static FileSystem Create ( FtpConnectionConfig connectionConfig )
37+ {
38+ if ( connectionConfig == null )
39+ throw new ArgumentNullException ( nameof ( connectionConfig ) ) ;
4040
41- return new FileSystem ( new FtpFileSystemOperations ( connectionConfig ) ) ;
42- }
41+ return new FileSystem ( new FtpFileSystemOperations ( connectionConfig ) ) ;
4342 }
44- }
43+ }
0 commit comments