protected override ItemInfo GetItem(ListInfo list, string path) { var fullPath = PathUtility.JoinPath(list.Path, path); return((ItemInfo)Cache.GetObjectOrDefault(fullPath) ?? GetItemDirectly(list, path)); }
protected override bool HasItem(ListInfo list, string path) { if (path.EndsWith("/*")) { var parent = PathUtility.JoinPath(list.Path, PathUtility.GetParentPath(path)); if (parent.IsEmpty()) { return(list.HasChildren()); } } var fullPath = PathUtility.JoinPath(list.Path, path); if (Cache.GetObjectOrDefault(fullPath) == null) { try { var container = GetItemDirectly(list, path) as ContainerInfo; if (container == null) { return(false); } return(container.HasChildren()); } catch { return(false); } } return(true); }
protected override WebFolderInfo InferWebFolder(WebInfo web, string name) { var path = PathUtility.JoinPath(web.Path, name); return((WebFolderInfo)Cache.GetObjectOrDefault(path) ?? InferWebFolderDirectly(web, name)); }
// Implementation of the NavigatingConnector interface support from the parent class. // They look for their result first to the cache because they can be called multiple // times by the code in the connector, the drive provider or the originating cmdlet. protected override WebInfo GetWeb(string path) { return((WebInfo)Cache.GetObjectOrDefault(path) ?? GetWebDirectly(path)); }
// Reimplementation of the internal object access to utilize caching. protected override Info ExistsObjectInternal(string path) { return(Cache.GetObjectOrDefault(path) ?? base.ExistsObjectInternal(path)); }