private ulong GetDirectorySize(WebDAV.Directory dir) { if (dir == null) { return(0); } ulong size = 0; foreach (var child in dir.Children) { var childDir = child as WebDAV.Directory; if (childDir != null) { size += GetDirectorySize(childDir); } var childFile = child as WebDAV.File; if (childFile != null) { size += childFile.Size; } } return(size); }
protected internal override IEnumerable <string> DoGetSubDirectoryNames(FileSystemDirectory directory, bool recursive) { SVNFileSystemSession session = directory.Session as SVNFileSystemSession; WebDAV.Directory wdDirectory = GetSVNItem(directory) as WebDAV.Directory; WebDAV.Directory pathDirectory = session.WebDAV.Root.NavigatePath(wdDirectory.Path) as WebDAV.Directory; if (pathDirectory == null) { return(null); } return(pathDirectory.Directories.Select(c => c.Name)); }
protected internal override FileSystemSessionItem DoNavigate(FileSystemSession session, string path) { SVNFileSystemSession wdSession = session as SVNFileSystemSession; WebDAV.Item item = wdSession.WebDAV.Root.NavigatePath(path); WebDAV.Directory dir = item as WebDAV.Directory; if (dir != null) { return(new FileSystemDirectory(session, dir.Parent != null ? dir.Parent.Path : string.Empty, dir.Name, new SVNFSH(dir))); } WebDAV.File file = item as WebDAV.File; if (file != null) { return(new FileSystemFile(session, file.Parent.Path, file.Name, new SVNFSH(file))); } return(null); }