Table of Contents

Class FluentFtpWrapper

Namespace
SunamoFluentFtp.FtpClients
Assembly
SunamoFluentFtp.dll

Wrapper for FluentFTP client providing high-level FTP operations. Elements of this class are made public because their parent elements must be at most internal. Therefore they cannot be public here.

public class FluentFtpWrapper : FtpBaseNewFluentFtp
Inheritance
FluentFtpWrapper
Inherited Members
Extension Methods

Properties

Adds

Additional functionality for the FTP client

public FluentFtpAdds Adds { get; set; }

Property Value

FluentFtpAdds

Client

The FluentFTP client instance

public FtpClient? Client { get; set; }

Property Value

FtpClient

Methods

ChdirLite(string)

Changes directory (lite version, must be here due to interface)

public override void ChdirLite(string directoryName)

Parameters

directoryName string

Directory name

Connect()

Connects to the FTP server

public override void Connect()

CreateDirectoryIfNotExists(string)

Creates a directory if it doesn't exist

public override void CreateDirectoryIfNotExists(string directoryName)

Parameters

directoryName string

Name of the directory to create

Debug(string, string, params object[])

Debug method with custom message

public override 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 working directory

public override void DebugActualFolder()

DebugAllEntries()

Debugs all directory entries

public override void DebugAllEntries()

DebugDirChmod(string)

Debugs directory permissions

public override void DebugDirChmod(string directory)

Parameters

directory string

Directory path

DeleteRecursively(List<string>, string, int, List<DirectoriesToDeleteFluentFtp>)

Deletes directory recursively

public override 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 override bool DeleteRemoteFile(string fileName)

Parameters

fileName string

Name of the file to delete

Returns

bool

True if successful

Dispose()

Disposes the FTP client. IDisposable cannot be here - since it is in _sunamo, it must be internal. Therefore it is here as internal override.

public override void Dispose()

Download(string, string, bool)

Downloads a file from remote to local

public override 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 override 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 override long GetFileSize(string fileName)

Parameters

fileName string

Name of the file

Returns

long

File size in bytes

GoToPath(string)

Navigates to specified path. In FluentFTP this is not strictly necessary but maintained for interface compatibility.

public override void GoToPath(string remotePath)

Parameters

remotePath string

Path on the hosting server

GoToUpFolder()

Navigates to parent folder

public override void GoToUpFolder()

GoToUpFolderForce()

Forces navigation to parent folder

public override void GoToUpFolderForce()

ListDirectoryDetails()

Lists directory details

public override List<string>? ListDirectoryDetails()

Returns

List<string>

List of directory entries

LoginIfIsNot(bool)

Logs in if not already logged in

public override void LoginIfIsNot(bool isStartup)

Parameters

isStartup bool

Whether this is a startup login

Mkdir(string)

Creates a directory

public override bool Mkdir(string directoryName)

Parameters

directoryName string

Name of the directory

Returns

bool

True if successful

RenameRemoteFile(string, string)

Renames a remote file

public override 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 override 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

TestBasicFunctionality()

Tests basic FTP functionality

public void TestBasicFunctionality()

UploadFile(string)

Uploads a file to the server

public override Task UploadFile(string path)

Parameters

path string

Local file path

Returns

Task