Class FtpAbstractFluentFtp
- Namespace
- SunamoFluentFtp._public.SunamoFtp.Base
- Assembly
- SunamoFluentFtp.dll
Abstract base class for FTP operations
public abstract class FtpAbstractFluentFtp
- Inheritance
-
FtpAbstractFluentFtp
- Derived
- Inherited Members
- Extension Methods
Properties
ExceptionCount
Number of exceptions for one operation - ideal for counting up to 3 and then canceling the entire operation
protected int ExceptionCount { get; set; }
Property Value
FolderSizeRec
Total folder size (recursive)
public ulong FolderSizeRec { get; set; }
Property Value
IsLoggedIn
Indicates whether the user is logged in
public bool IsLoggedIn { get; set; }
Property Value
MaxExceptionCount
Maximum number of exceptions allowed before operation is canceled
protected int MaxExceptionCount { get; set; }
Property Value
PathSelector
Path selector for managing directory paths. Public only because of the Ftp class
public PathSelectorFluentFtp? PathSelector { get; set; }
Property Value
ReallyUpload
If set to false, nothing will be uploaded to hosting - only used in this class, everything else will work normally
public bool ReallyUpload { get; set; }
Property Value
RemoteHost
Remote host address
public string? RemoteHost { get; set; }
Property Value
RemotePass
Password for user authentication - sent with PASS command
public string? RemotePass { get; set; }
Property Value
RemotePort
Remote port number
public int RemotePort { get; set; }
Property Value
RemoteUser
User attempting to login - used with USER command
public string? RemoteUser { get; set; }
Property Value
Startup
Indicates whether this is a startup operation
protected bool Startup { get; set; }
Property Value
Methods
ChdirLite(string)
Changes directory (lite version)
public abstract void ChdirLite(string directoryName)
Parameters
directoryNamestringDirectory name
Connect()
Connects to the FTP server
public abstract void Connect()
CreateDirectoryIfNotExists(string)
Creates a directory if it doesn't exist
public abstract void CreateDirectoryIfNotExists(string directoryName)
Parameters
directoryNamestringName of the directory to create
Debug(string, string, params object[])
Debug method with custom message
public abstract void Debug(string what, string text, params object[] args)
Parameters
whatstringType of debug information
textstringDebug message text
argsobject[]Optional format arguments
DebugActualFolder()
Debugs the current folder
public abstract void DebugActualFolder()
DeleteRecursively(List<string>, string, int, List<DirectoriesToDeleteFluentFtp>)
Deletes directory recursively
public abstract void DeleteRecursively(List<string> excludedDirectories, string directoryName, int depth, List<DirectoriesToDeleteFluentFtp> directoriesToDelete)
Parameters
excludedDirectoriesList<string>Directories to exclude from deletion
directoryNamestringName of the directory to delete
depthintRecursion depth
directoriesToDeleteList<DirectoriesToDeleteFluentFtp>List of directories to delete
DeleteRemoteFile(string)
Deletes a remote file
public abstract bool DeleteRemoteFile(string fileName)
Parameters
fileNamestringName of the file to delete
Returns
- bool
True if successful
Download(string, string, bool)
Downloads a file from remote to local
public abstract bool Download(string remoteFileName, string localFileName, bool isDeleteLocalIfExists)
Parameters
remoteFileNamestringRemote file name
localFileNamestringLocal file name
isDeleteLocalIfExistsboolWhether to delete local file if it exists
Returns
- bool
True if successful
GetFSEntriesListRecursively(List<string>)
Gets filesystem entries list recursively
public abstract Dictionary<string, List<string>>? GetFSEntriesListRecursively(List<string> excludedDirectories)
Parameters
Returns
- Dictionary<string, List<string>>
Dictionary of directories and their contents
GetFileSize(string)
Gets the size of a file
public abstract long GetFileSize(string fileName)
Parameters
fileNamestringName of the file
Returns
- long
File size in bytes
GetRemoteHost()
Gets the remote host address
public string? GetRemoteHost()
Returns
- string
Remote host address
GetRemotePort()
Gets the port used for remote transfer
public int GetRemotePort()
Returns
- int
Remote port number
GoToPath(string)
Navigates to specified path
public abstract void GoToPath(string remotePath)
Parameters
remotePathstringPath on the hosting server
GoToUpFolder()
Navigates to parent folder
public abstract void GoToUpFolder()
GoToUpFolderForce()
Forces navigation to parent folder
public abstract void GoToUpFolderForce()
ListDirectoryDetails()
Lists directory details
public abstract List<string>? ListDirectoryDetails()
Returns
LoginIfIsNot(bool)
Logs in if not already logged in
public abstract void LoginIfIsNot(bool isStartup)
Parameters
isStartupboolWhether this is a startup login
Mkdir(string)
Creates a directory
public abstract bool Mkdir(string directoryName)
Parameters
directoryNamestringName of the directory to create
Returns
- bool
True if successful
RenameRemoteFile(string, string)
Renames a remote file
public abstract void RenameRemoteFile(string oldFileName, string newFileName)
Parameters
Rmdir(List<string>, string)
Removes a directory
public abstract bool Rmdir(List<string> excludedDirectories, string directoryName)
Parameters
excludedDirectoriesList<string>Directories to exclude from operation
directoryNamestringName of the directory to remove
Returns
- bool
True if successful
SetRemoteHost(string)
Sets the remote host address
public void SetRemoteHost(string remoteHost)
Parameters
remoteHoststringRemote host address
SetRemotePass(string)
Sets the remote user password
public void SetRemotePass(string remotePass)
Parameters
remotePassstringRemote user password
SetRemotePort(int)
Sets the remote port number
public void SetRemotePort(int remotePort)
Parameters
remotePortintRemote port number
SetRemoteUser(string)
Sets the remote user name
public void SetRemoteUser(string remoteUser)
Parameters
remoteUserstringRemote user name