Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetPathInfo()

static void System.Net.FtpControlStream.GetPathInfo ( GetPathOption pathOption,
Uri uri,
out string path,
out string directory,
out string filename )
inlinestaticprivate

Definition at line 622 of file FtpControlStream.cs.

623 {
624 path = uri.GetComponents(UriComponents.Path, UriFormat.Unescaped);
625 int num = path.LastIndexOf('/');
626 if (pathOption == GetPathOption.AssumeFilename && num != -1 && num == path.Length - 1)
627 {
628 path = path.Substring(0, path.Length - 1);
629 num = path.LastIndexOf('/');
630 }
631 if (pathOption == GetPathOption.AssumeNoFilename)
632 {
633 directory = path;
634 filename = string.Empty;
635 }
636 else
637 {
638 directory = path.Substring(0, num + 1);
639 filename = path.Substring(num + 1, path.Length - (num + 1));
640 }
641 if (directory.Length > 1 && directory[directory.Length - 1] == '/')
642 {
643 directory = directory.Substring(0, directory.Length - 1);
644 }
645 }
UriFormat
Definition UriFormat.cs:4

References System.Uri.GetComponents().

Referenced by System.Net.FtpControlStream.BuildCommandsList().