public static LocalPath CreateFromUniversal(UniversalPath path, LocalFolderRoot root) { var rootPath = root.Value; var separator = Path.DirectorySeparatorChar.ToString(); if (!root.Value.EndsWith(separator)) { rootPath = rootPath + separator; } var localRelativePath = path.Value.Replace("/", separator); var combine = Path.GetFullPath(rootPath + localRelativePath); var result = new LocalPath { Root = root, Value = combine }; return(result); }
public LocalPath ReplaceRoot(LocalFolderRoot newParent) { return(new LocalPath(this.Value.Replace(this.Root.Value, newParent.Value), newParent)); }
public LocalPath(string path, LocalFolderRoot root) { this.Root = root; // mac filesystem uses some messed up unicode this.Value = path?.Normalize(NormalizationForm.FormC); }