示例#1
0
        public async Task  Unpublish(File file)
        {
            foreach (var innerFile in file.Files)
            {
                await Unpublish(innerFile.GetPublicLinks(this).First().Uri, innerFile.FullPath);

                innerFile.PublicLinks.Clear();
            }
            _itemCache.Invalidate(file.FullPath, file.Path);
        }
示例#2
0
        /// <summary>
        /// Убрать ссылку
        /// </summary>
        /// <param name="path"></param>
        /// <param name="doSave">Save container after removing</param>
        public bool RemoveLink(string path, bool doSave = true)
        {
            var name   = WebDavPath.Name(path);
            var parent = WebDavPath.Parent(path);

            var z = _itemList.Items.FirstOrDefault(f => f.MapTo == parent && f.Name == name);

            if (z != null)
            {
                _itemList.Items.Remove(z);
                _itemCache.Invalidate(path, parent);
                if (doSave)
                {
                    Save();
                }
                return(true);
            }
            return(false);
        }
示例#3
0
        public async Task  Unpublish(File file)
        {
            foreach (var innerFile in file.Files)
            {
                await Unpublish(innerFile.PublicLink);

                innerFile.PublicLink = string.Empty;
            }
            _itemCache.Invalidate(file.FullPath, file.Path);
        }