Interface IFtpClient
- Namespace
- FluentFTP
- Assembly
- FluentFTP.dll
Interface for the FtpClient class. For detailed documentation of the methods, please see the FtpClient class or check the Wiki on the FluentFTP Github project.
public interface IFtpClient : IDisposable, IBaseFtpClient
- Inherited Members
- Extension Methods
Methods
AutoConnect()
FtpProfile AutoConnect()
Returns
AutoDetect(FtpAutoDetectConfig)
List<FtpProfile> AutoDetect(FtpAutoDetectConfig config)
Parameters
config
FtpAutoDetectConfig
Returns
AutoDetect(bool, bool)
List<FtpProfile> AutoDetect(bool firstOnly, bool cloneConnection = true)
Parameters
Returns
Chmod(string, FtpPermission, FtpPermission, FtpPermission)
void Chmod(string path, FtpPermission owner, FtpPermission group, FtpPermission other)
Parameters
path
stringowner
FtpPermissiongroup
FtpPermissionother
FtpPermission
Chmod(string, int)
void Chmod(string path, int permissions)
Parameters
CompareFile(string, string, FtpCompareOption)
FtpCompareResult CompareFile(string localPath, string remotePath, FtpCompareOption options = FtpCompareOption.Auto)
Parameters
localPath
stringremotePath
stringoptions
FtpCompareOption
Returns
Connect()
void Connect()
Connect(FtpProfile)
void Connect(FtpProfile profile)
Parameters
profile
FtpProfile
Connect(bool)
void Connect(bool reConnect)
Parameters
reConnect
bool
CreateDirectory(string)
bool CreateDirectory(string path)
Parameters
path
string
Returns
CreateDirectory(string, bool)
bool CreateDirectory(string path, bool force)
Parameters
Returns
DeleteDirectory(string)
void DeleteDirectory(string path)
Parameters
path
string
DeleteDirectory(string, FtpListOption)
void DeleteDirectory(string path, FtpListOption options)
Parameters
path
stringoptions
FtpListOption
DeleteFile(string)
void DeleteFile(string path)
Parameters
path
string
DirectoryExists(string)
bool DirectoryExists(string path)
Parameters
path
string
Returns
DisableUTF8()
void DisableUTF8()
Disconnect()
void Disconnect()
DownloadBytes(out byte[], string, long, Action<FtpProgress>, long)
bool DownloadBytes(out byte[] outBytes, string remotePath, long restartPosition = 0, Action<FtpProgress> progress = null, long stopPosition = 0)
Parameters
outBytes
byte[]remotePath
stringrestartPosition
longprogress
Action<FtpProgress>stopPosition
long
Returns
DownloadDirectory(string, string, FtpFolderSyncMode, FtpLocalExists, FtpVerify, List<FtpRule>, Action<FtpProgress>)
List<FtpResult> DownloadDirectory(string localFolder, string remoteFolder, FtpFolderSyncMode mode = FtpFolderSyncMode.Update, FtpLocalExists existsMode = FtpLocalExists.Skip, FtpVerify verifyOptions = FtpVerify.None, List<FtpRule> rules = null, Action<FtpProgress> progress = null)
Parameters
localFolder
stringremoteFolder
stringmode
FtpFolderSyncModeexistsMode
FtpLocalExistsverifyOptions
FtpVerifyrules
List<FtpRule>progress
Action<FtpProgress>
Returns
DownloadFile(string, string, FtpLocalExists, FtpVerify, Action<FtpProgress>)
FtpStatus DownloadFile(string localPath, string remotePath, FtpLocalExists existsMode = FtpLocalExists.Overwrite, FtpVerify verifyOptions = FtpVerify.None, Action<FtpProgress> progress = null)
Parameters
localPath
stringremotePath
stringexistsMode
FtpLocalExistsverifyOptions
FtpVerifyprogress
Action<FtpProgress>
Returns
DownloadFiles(string, IEnumerable<string>, FtpLocalExists, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)
List<FtpResult> DownloadFiles(string localDir, IEnumerable<string> remotePaths, FtpLocalExists existsMode = FtpLocalExists.Overwrite, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)
Parameters
localDir
stringremotePaths
IEnumerable<string>existsMode
FtpLocalExistsverifyOptions
FtpVerifyerrorHandling
FtpErrorprogress
Action<FtpProgress>rules
List<FtpRule>
Returns
DownloadStream(Stream, string, long, Action<FtpProgress>, long)
bool DownloadStream(Stream outStream, string remotePath, long restartPosition = 0, Action<FtpProgress> progress = null, long stopPosition = 0)
Parameters
outStream
StreamremotePath
stringrestartPosition
longprogress
Action<FtpProgress>stopPosition
long
Returns
DownloadUriBytes(out byte[], string, Action<FtpProgress>)
bool DownloadUriBytes(out byte[] outBytes, string uri, Action<FtpProgress> progress = null)
Parameters
outBytes
byte[]uri
stringprogress
Action<FtpProgress>
Returns
EmptyDirectory(string)
void EmptyDirectory(string path)
Parameters
path
string
EmptyDirectory(string, FtpListOption)
void EmptyDirectory(string path, FtpListOption options)
Parameters
path
stringoptions
FtpListOption
Execute(string)
FtpReply Execute(string command)
Parameters
command
string
Returns
ExecuteDownloadText(string)
List<string> ExecuteDownloadText(string command)
Parameters
command
string
Returns
FileExists(string)
bool FileExists(string path)
Parameters
path
string
Returns
GetChecksum(string, FtpHashAlgorithm)
FtpHash GetChecksum(string path, FtpHashAlgorithm algorithm = FtpHashAlgorithm.NONE)
Parameters
path
stringalgorithm
FtpHashAlgorithm
Returns
GetChmod(string)
int GetChmod(string path)
Parameters
path
string
Returns
GetFilePermissions(string)
FtpListItem GetFilePermissions(string path)
Parameters
path
string
Returns
GetFileSize(string, long)
long GetFileSize(string path, long defaultValue = -1)
Parameters
Returns
GetListing()
FtpListItem[] GetListing()
Returns
GetListing(string)
FtpListItem[] GetListing(string path)
Parameters
path
string
Returns
GetListing(string, FtpListOption)
FtpListItem[] GetListing(string path, FtpListOption options)
Parameters
path
stringoptions
FtpListOption
Returns
GetModifiedTime(string)
DateTime GetModifiedTime(string path)
Parameters
path
string
Returns
GetNameListing()
string[] GetNameListing()
Returns
- string[]
GetNameListing(string)
string[] GetNameListing(string path)
Parameters
path
string
Returns
- string[]
GetObjectInfo(string, bool)
FtpListItem GetObjectInfo(string path, bool dateModified = false)
Parameters
Returns
GetReply()
FtpReply GetReply()
Returns
GetWorkingDirectory()
string GetWorkingDirectory()
Returns
HasFeature(FtpCapability)
bool HasFeature(FtpCapability cap)
Parameters
cap
FtpCapability
Returns
MoveDirectory(string, string, FtpRemoteExists)
bool MoveDirectory(string path, string dest, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite)
Parameters
path
stringdest
stringexistsMode
FtpRemoteExists
Returns
MoveFile(string, string, FtpRemoteExists)
bool MoveFile(string path, string dest, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite)
Parameters
path
stringdest
stringexistsMode
FtpRemoteExists
Returns
OpenAppend(string, FtpDataType, bool)
Stream OpenAppend(string path, FtpDataType type = FtpDataType.Binary, bool checkIfFileExists = true)
Parameters
path
stringtype
FtpDataTypecheckIfFileExists
bool
Returns
OpenAppend(string, FtpDataType, long)
Stream OpenAppend(string path, FtpDataType type, long fileLen)
Parameters
path
stringtype
FtpDataTypefileLen
long
Returns
OpenRead(string, FtpDataType, long, bool)
Stream OpenRead(string path, FtpDataType type = FtpDataType.Binary, long restart = 0, bool checkIfFileExists = true)
Parameters
path
stringtype
FtpDataTyperestart
longcheckIfFileExists
bool
Returns
OpenRead(string, FtpDataType, long, long)
Stream OpenRead(string path, FtpDataType type, long restart, long fileLen)
Parameters
path
stringtype
FtpDataTyperestart
longfileLen
long
Returns
OpenWrite(string, FtpDataType, bool)
Stream OpenWrite(string path, FtpDataType type = FtpDataType.Binary, bool checkIfFileExists = true)
Parameters
path
stringtype
FtpDataTypecheckIfFileExists
bool
Returns
OpenWrite(string, FtpDataType, long)
Stream OpenWrite(string path, FtpDataType type, long fileLen)
Parameters
path
stringtype
FtpDataTypefileLen
long
Returns
Rename(string, string)
void Rename(string path, string dest)
Parameters
SetFilePermissions(string, FtpPermission, FtpPermission, FtpPermission)
void SetFilePermissions(string path, FtpPermission owner, FtpPermission group, FtpPermission other)
Parameters
path
stringowner
FtpPermissiongroup
FtpPermissionother
FtpPermission
SetFilePermissions(string, int)
void SetFilePermissions(string path, int permissions)
Parameters
SetModifiedTime(string, DateTime)
void SetModifiedTime(string path, DateTime date)
Parameters
SetWorkingDirectory(string)
void SetWorkingDirectory(string path)
Parameters
path
string
UploadBytes(byte[], string, FtpRemoteExists, bool, Action<FtpProgress>)
FtpStatus UploadBytes(byte[] fileData, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, Action<FtpProgress> progress = null)
Parameters
fileData
byte[]remotePath
stringexistsMode
FtpRemoteExistscreateRemoteDir
boolprogress
Action<FtpProgress>
Returns
UploadDirectory(string, string, FtpFolderSyncMode, FtpRemoteExists, FtpVerify, List<FtpRule>, Action<FtpProgress>)
List<FtpResult> UploadDirectory(string localFolder, string remoteFolder, FtpFolderSyncMode mode = FtpFolderSyncMode.Update, FtpRemoteExists existsMode = FtpRemoteExists.Skip, FtpVerify verifyOptions = FtpVerify.None, List<FtpRule> rules = null, Action<FtpProgress> progress = null)
Parameters
localFolder
stringremoteFolder
stringmode
FtpFolderSyncModeexistsMode
FtpRemoteExistsverifyOptions
FtpVerifyrules
List<FtpRule>progress
Action<FtpProgress>
Returns
UploadFile(string, string, FtpRemoteExists, bool, FtpVerify, Action<FtpProgress>)
FtpStatus UploadFile(string localPath, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, FtpVerify verifyOptions = FtpVerify.None, Action<FtpProgress> progress = null)
Parameters
localPath
stringremotePath
stringexistsMode
FtpRemoteExistscreateRemoteDir
boolverifyOptions
FtpVerifyprogress
Action<FtpProgress>
Returns
UploadFiles(IEnumerable<FileInfo>, string, FtpRemoteExists, bool, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)
List<FtpResult> UploadFiles(IEnumerable<FileInfo> localFiles, string remoteDir, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)
Parameters
localFiles
IEnumerable<FileInfo>remoteDir
stringexistsMode
FtpRemoteExistscreateRemoteDir
boolverifyOptions
FtpVerifyerrorHandling
FtpErrorprogress
Action<FtpProgress>rules
List<FtpRule>
Returns
UploadFiles(IEnumerable<string>, string, FtpRemoteExists, bool, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)
List<FtpResult> UploadFiles(IEnumerable<string> localPaths, string remoteDir, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)
Parameters
localPaths
IEnumerable<string>remoteDir
stringexistsMode
FtpRemoteExistscreateRemoteDir
boolverifyOptions
FtpVerifyerrorHandling
FtpErrorprogress
Action<FtpProgress>rules
List<FtpRule>
Returns
UploadStream(Stream, string, FtpRemoteExists, bool, Action<FtpProgress>)
FtpStatus UploadStream(Stream fileStream, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, Action<FtpProgress> progress = null)
Parameters
fileStream
StreamremotePath
stringexistsMode
FtpRemoteExistscreateRemoteDir
boolprogress
Action<FtpProgress>