Source/NFX.Web/IO/FileSystem/SVN/WebDAV.cs
/// <summary>
/// Tries to navigate path and returns destination directory, file or null if its not found
/// </summary>
Tries to navigate path and returns destination directory, file or null if its not found
Tries to navigate path and returns destination directory file or null if its not found
public Item NavigatePath(string path)
        {
          if (path.IsNullOrWhiteSpace()) return this;
          var segs = path.Split( SEPARATORS, StringSplitOptions.RemoveEmptyEntries);
          Directory item = this;
          for (int i = 0; i < segs.Length; i++)
          {
            string seg = segs[i];
            Directory dir = item[seg] as Directory;
            if (dir != null)
            {
              item = dir;
              continue;
            }
            if (i == segs.Length-1) 
            {
              File file = item[seg] as File;
              return file;
            }
            else
              return null;
          }
          return item;
        }
public Item NavigatePath ( string path ) { if ( path . IsNullOrWhiteSpace ( ) ) return this ; var segs = path . Split ( SEPARATORS , StringSplitOptions . RemoveEmptyEntries ) ; Directory item = this ; for ( int i = 0 ; i < segs . Length ; i ++ ) { string seg = segs [ i ] ; Directory dir = item [ seg ] as Directory ; if ( dir != null ) { item = dir ; continue ; } if ( i == segs . Length - 1 ) { File file = item [ seg ] as File ; return file ; } else return null ; } return item ; }
Tries to navigate path and returns destination directory, file or null if its not found
Tries to navigate path and returns destination directory file or null if its not found
// last segment
path
string