Table of Contents

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

int

FolderSizeRec

Total folder size (recursive)

public ulong FolderSizeRec { get; set; }

Property Value

ulong

IsLoggedIn

Indicates whether the user is logged in

public bool IsLoggedIn { get; set; }

Property Value

bool

MaxExceptionCount

Maximum number of exceptions allowed before operation is canceled

protected int MaxExceptionCount { get; set; }

Property Value

int

PathSelector

Path selector for managing directory paths. Public only because of the Ftp class

public PathSelectorFluentFtp? PathSelector { get; set; }

Property Value

PathSelectorFluentFtp

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

bool

RemoteHost

Remote host address

public string? RemoteHost { get; set; }

Property Value

string

RemotePass

Password for user authentication - sent with PASS command

public string? RemotePass { get; set; }

Property Value

string

RemotePort

Remote port number

public int RemotePort { get; set; }

Property Value

int

RemoteUser

User attempting to login - used with USER command

public string? RemoteUser { get; set; }

Property Value

string

Startup

Indicates whether this is a startup operation

protected bool Startup { get; set; }

Property Value

bool

Methods

ChdirLite(string)

Changes directory (lite version)

public abstract void ChdirLite(string directoryName)

Parameters

directoryName string

Directory 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

directoryName string

Name 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

what string

Type of debug information

text string

Debug message text

args object[]

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

excludedDirectories List<string>

Directories to exclude from deletion

directoryName string

Name of the directory to delete

depth int

Recursion depth

directoriesToDelete List<DirectoriesToDeleteFluentFtp>

List of directories to delete

DeleteRemoteFile(string)

Deletes a remote file

public abstract bool DeleteRemoteFile(string fileName)

Parameters

fileName string

Name 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

remoteFileName string

Remote file name

localFileName string

Local file name

isDeleteLocalIfExists bool

Whether 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

excludedDirectories List<string>

Directories to exclude from listing

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

fileName string

Name 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

remotePath string

Path 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

List<string>

List of directory entries

LoginIfIsNot(bool)

Logs in if not already logged in

public abstract void LoginIfIsNot(bool isStartup)

Parameters

isStartup bool

Whether this is a startup login

Mkdir(string)

Creates a directory

public abstract bool Mkdir(string directoryName)

Parameters

directoryName string

Name 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

oldFileName string

Current file name

newFileName string

New file name

Rmdir(List<string>, string)

Removes a directory

public abstract bool Rmdir(List<string> excludedDirectories, string directoryName)

Parameters

excludedDirectories List<string>

Directories to exclude from operation

directoryName string

Name of the directory to remove

Returns

bool

True if successful

SetRemoteHost(string)

Sets the remote host address

public void SetRemoteHost(string remoteHost)

Parameters

remoteHost string

Remote host address

SetRemotePass(string)

Sets the remote user password

public void SetRemotePass(string remotePass)

Parameters

remotePass string

Remote user password

SetRemotePort(int)

Sets the remote port number

public void SetRemotePort(int remotePort)

Parameters

remotePort int

Remote port number

SetRemoteUser(string)

Sets the remote user name

public void SetRemoteUser(string remoteUser)

Parameters

remoteUser string

Remote user name