Example #1
0
        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);
        }
Example #2
0
 public LocalPath ReplaceRoot(LocalFolderRoot newParent)
 {
     return(new LocalPath(this.Value.Replace(this.Root.Value, newParent.Value), newParent));
 }
Example #3
0
 public LocalPath(string path, LocalFolderRoot root)
 {
     this.Root = root;
     // mac filesystem uses some messed up unicode
     this.Value = path?.Normalize(NormalizationForm.FormC);
 }