System.Net.FtpClient.FtpExtensions.GetFtpDirectoryName C# (CSharp) Method

GetFtpDirectoryName() public static method

Gets the directory name of a path formatted for a FTP server
public static GetFtpDirectoryName ( this path ) : string
path this The path
return string
        public static string GetFtpDirectoryName(this string path)
        {
            if (path == null || path.Length == 0 || path.GetFtpPath() == "/")
                return "/";

            return System.IO.Path.GetDirectoryName(path).GetFtpPath();
        }