Esempio n. 1
0
        public bool FileExists(string path)
        {
            Guard.NotEmpty(path, nameof(path));

            if (_helper.TokenizePath(path, false, out var tokens))
            {
                return(_fileRepo.Table.Any(x => x.FolderId == tokens.Folder.Id && x.Name == tokens.FileName));
            }

            return(false);
        }
Esempio n. 2
0
        public IFolder GetFolderForFile(string path)
        {
            if (!_mediaHelper.TokenizePath(path, false, out var pathData))
            {
                throw _exceptionFactory.FolderNotFound(Fix(Path.GetDirectoryName(path)));
            }

            return(new MediaFolderInfo(pathData.Node));
        }