Exemple #1
0
        public FileInfo GetFile(string name)
        {
            var fileRef = ShortCode.TryParse(name, out var c)
                ? _index.GetFile(c)
                : _index.GetFileByName(c);

            return(new FileInfo(Path.Combine(_uploadService.RootPath.FullName, fileRef.Location)));
        }
Exemple #2
0
        public async Task <bool> Handle(ModDeleteRequest request, CancellationToken cancellationToken, RequestHandlerDelegate <bool> next)
        {
            var result = await next();

            if (result)
            {
                var fileEntry = _index.GetFileByName(request.FileName);
                _index.RemoveFile(fileEntry.Id);
            }
            return(result);
        }