public Local(string?name, string path) : base(path) { if (string.IsNullOrEmpty(name)) { if (!path.EndsWith("/")) { // Intentionally use GetFileName here, as the directory name // may be a "file-like name" e.g. myfolder.txt, in which case // GetDirectoryName would actually return the parent. name = IOPath.GetFileName(path); } else { name = IOPath.GetDirectoryName(path); } } _name = name ?? string.Empty; }
internal StorageFolder(string fullPath) : this(new Local(IOPath.GetFileName(fullPath), fullPath)) { }