Class RemotePaths
Extension methods related to FTP tasks
public static class RemotePaths
- Inheritance
-
RemotePaths
- Inherited Members
Methods
CalculateFullFtpPath(FtpListItem, BaseFtpClient, string)
Get the full path of a given FTP Listing entry
public static void CalculateFullFtpPath(this FtpListItem item, BaseFtpClient client, string path)
Parameters
item
FtpListItemclient
BaseFtpClientpath
string
GetFtpDirectoryName(string)
Gets the parent directory path (formatted for a FTP server)
public static string GetFtpDirectoryName(this string path)
Parameters
path
stringThe path
Returns
- string
The parent directory path
GetFtpFileName(string)
Gets the file name and extension from the path. Supports paths with backslashes and forwardslashes.
public static string GetFtpFileName(this string path)
Parameters
path
stringThe full path to the file
Returns
- string
The file name
GetFtpPath(string)
Converts the specified path into a valid FTP file system path. Replaces invalid back-slashes with valid forward-slashes. Replaces multiple slashes with single slashes. Removes the ending postfix slash if any.
public static string GetFtpPath(this string path)
Parameters
path
stringThe file system path
Returns
- string
A path formatted for FTP
GetFtpPath(string, params string[])
Creates a valid FTP path by appending the specified segments to this string
public static string GetFtpPath(this string path, params string[] segments)
Parameters
Returns
- string
A valid FTP path
GetPathSegments(string)
Converts a Windows or Unix-style path into its segments for segment-wise processing
public static string[] GetPathSegments(this string path)
Parameters
path
string
Returns
- string[]
IsAbsolutePath(string)
Checks if this FTP path is a top level path
public static bool IsAbsolutePath(this string path)
Parameters
path
string
Returns
IsFtpRootDirectory(string)
Checks if the given path is a root directory or working directory path
public static bool IsFtpRootDirectory(this string ftppath)
Parameters
ftppath
string