A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/robinrodricks/FluentFTP/wiki/v40-Migration-Guide below:

v40 Migration Guide · robinrodricks/FluentFTP Wiki · GitHub

This guide helps you migrate from v39 and older releases to v40+ and newer releases.

FluentFTP has had a long and colorful history of development. While we have always strived to rapidly add features and release them often, we have not really had the time to design our API surface according to well-defined principles.

In this release our goals were to:

  1. Cleanup the API surface
  2. Improve the configuration methodology
  3. Improve the logging methodology
  4. Fix technical debt by dropping old frameworks
  5. Modernize the codebase
  6. Improve code organization

Instead of making multiple releases with constant breaking API changes, I decided to roll this into a single large release. v40 is the culmination of all of the above goals.

The full discussion can be found here.

The following is a brief overview on the major changes in v40+.

The full release notes can be found here.

The FTP client has now been split into 2 main classes, FtpClient and AsyncFtpClient. You will have to select one client based on the type of API you need, and stick with that type of API for the lifetime of that class. It is no longer possible to mix sync and async API calls.

This table lists out all the clients available, including proxy clients:

Synchronous Clients Asynchronous Clients FtpClient AsyncFtpClient FtpClientHttp11Proxy AsyncFtpClientHttp11Proxy FtpClientProxy AsyncFtpClientProxy FtpClientSocks4aProxy AsyncFtpClientSocks4aProxy FtpClientSocks4Proxy AsyncFtpClientSocks4Proxy FtpClientSocks5Proxy AsyncFtpClientSocks5Proxy FtpClientUserAtHostProxy AsyncFtpClientUserAtHostProxy FtpClientBlueCoatProxy AsyncFtpClientBlueCoatProxy 2. Migrate your constructors

The following constructors have been introduced:

The following constructors have been deleted:

3. Migrate your interfaces

The interface IFtpClient has now been split into 2 interfaces: IFtpClient and IAsyncFtpClient.

If you have programmed against interfaces, you will have to select one interface based on the type of API you are using.

4. Migrate your Async methods

All async methods are now available inside AsyncFtpClient and they have the Async suffix removed.

The full list of changes are given below:

Old method names New method names ConnectAsync() Connect() AutoDetectAsync() AutoDetect() AutoConnectAsync() AutoConnect() DisconnectAsync() Disconnect() ExecuteAsync() Execute() GetReplyAsync() GetReply() DeleteFileAsync() DeleteFile() DeleteDirectoryAsync() DeleteDirectory() DirectoryExistsAsync() DirectoryExists() FileExistsAsync() FileExists() CreateDirectoryAsync() CreateDirectory() RenameAsync() Rename() MoveFileAsync() MoveFile() MoveDirectoryAsync() MoveDirectory() SetFilePermissionsAsync() SetFilePermissions() ChmodAsync() Chmod() GetFilePermissionsAsync() GetFilePermissions() GetChmodAsync() GetChmod() SetWorkingDirectoryAsync() SetWorkingDirectory() GetWorkingDirectoryAsync() GetWorkingDirectory() GetFileSizeAsync() GetFileSize() GetModifiedTimeAsync() GetModifiedTime() SetModifiedTimeAsync() SetModifiedTime() GetObjectInfoAsync() GetObjectInfo() GetListingAsync() GetListing() GetNameListingAsync() GetNameListing() OpenReadAsync() OpenRead() OpenWriteAsync() OpenWrite() OpenAppendAsync() OpenAppend() UploadFilesAsync() UploadFiles() DownloadFilesAsync() DownloadFiles() UploadFileAsync() UploadFile() UploadStreamAsync() UploadStream() UploadBytesAsync() UploadBytes() DownloadFileAsync() DownloadFile() DownloadStreamAsync() DownloadStream() DownloadBytesAsync() DownloadBytes() DownloadDirectoryAsync() DownloadDirectory() UploadDirectoryAsync() UploadDirectory() GetChecksumAsync() GetChecksum() CompareFileAsync() CompareFile() 5. Change your configuration

All of the configuration settings have now been moved into the Config property within the FtpClient objects. You can specify the config in the constructor (optional) and/or you can change individual properties at any time. You can also reassign the Config property on the fly at any time.

The full list of changes are given below:

Old property names New property names client.QuickTransferLimit (removed) client.MaximumDereferenceCount (removed) client.EnableThreadSafeDataConnections (removed) client.PlainTextEncryption (removed) FtpTrace.LogFunctions (removed) FtpTrace.LogIP client.Config.LogHost FtpTrace.LogUserName client.Config.LogUserName FtpTrace.LogPassword client.Config.LogPassword FtpTrace.LogToConsole client.Config.LogToConsole client.OnLogEvent client.LegacyLogger client.BulkListing client.Config.BulkListing client.BulkListingLength client.Config.BulkListingLength client.ActivePorts client.Config.ActivePorts client.ClientCertificates client.Config.ClientCertificates client.ConnectTimeout client.Config.ConnectTimeout client.DataConnectionConnectTimeout client.Config.DataConnectionConnectTimeout client.DataConnectionEncryption client.Config.DataConnectionEncryption client.DataConnectionReadTimeout client.Config.DataConnectionReadTimeout client.DataConnectionType client.Config.DataConnectionType client.DisconnectWithQuit client.Config.DisconnectWithQuit client.DisconnectWithShutdown (removed) client.DownloadDataType client.Config.DownloadDataType client.DownloadDirectoryDeleteExcluded client.Config.DownloadDirectoryDeleteExcluded client.DownloadRateLimit client.Config.DownloadRateLimit client.DownloadZeroByteFiles client.Config.DownloadZeroByteFiles client.EncryptionMode client.Config.EncryptionMode client.FXPDataType client.Config.FXPDataType client.FXPProgressInterval client.Config.FXPProgressInterval client.InternetProtocolVersions client.Config.InternetProtocolVersions client.ListingCulture client.Config.ListingCulture client.ListingCustomParser client.Config.ListingCustomParser client.ListingDataType client.Config.ListingDataType client.ListingParser client.Config.ListingParser client.LocalFileBufferSize client.Config.LocalFileBufferSize client.LocalTimeZone client.Config.LocalTimeZone client.NoopInterval client.Config.NoopInterval client.PassiveBlockedPorts client.Config.PassiveBlockedPorts client.PassiveMaxAttempts client.Config.PassiveMaxAttempts client.PlainTextEncryption client.Config.PlainTextEncryption client.ReadTimeout client.Config.ReadTimeout client.RetryAttempts client.Config.RetryAttempts client.SendHost client.Config.SendHost client.SendHostDomain client.Config.SendHostDomain client.SocketKeepAlive client.Config.SocketKeepAlive client.SocketLocalIp client.Config.SocketLocalIp client.SocketPollInterval client.Config.SocketPollInterval client.SslBuffering client.Config.SslBuffering client.SslProtocols client.Config.SslProtocols client.StaleDataCheck client.Config.StaleDataCheck client.TimeConversion client.Config.TimeConversion client.TimeZone client.Config.TimeZone client.TransferChunkSize client.Config.TransferChunkSize client.UploadDataType client.Config.UploadDataType client.UploadDirectoryDeleteExcluded client.Config.UploadDirectoryDeleteExcluded client.UploadRateLimit client.Config.UploadRateLimit 6. Use the new Logging system

A new logging system has been introduced, wherein each FtpClient can now have its own logger assigned which can directly utilize any logger that implements a custom IFtpLogger interface. A sister package called FluentFTP.Logging helps you integrate this with the industry-standard MELA ILogger interface.

using FluentFTP;          // from NuGet package FluentFTP
using FluentFTP.Logging;  // from NuGet package FluentFTP.Logging

var client = new FtpClient();
client.Logger = new FtpLogAdapter(new Log4NetLogger())

The older console logger has been preserved but renamed. It provides the in-built ability to log to console. If you run FluentFTP in debug mode by building from source, it will also log to the debug console.

An older logging callback system has been preserved but renamed. It provides an easy way to consume FTP logging events if you don't want to use the new ILogger system.

The older logging settings have been preserved:

The older logging system has been removed, wherein you had a static class FtpTrace responsible for logging.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4