예제 #1
0
        public object Get(GetFile request)
        {
            var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager);

            if (item.LocationType == LocationType.Remote || item.LocationType == LocationType.Virtual)
            {
                throw new ArgumentException("This command cannot be used for remote or virtual items.");
            }
            if (Directory.Exists(item.Path))
            {
                throw new ArgumentException("This command cannot be used for directories.");
            }

            return(ToStaticFileResult(item.Path));
        }
예제 #2
0
        public object Get(GetFile request)
        {
            var item = _dtoService.GetItemByDtoId(request.Id);

            if (item.LocationType == LocationType.Remote || item.LocationType == LocationType.Virtual)
            {
                throw new ArgumentException("This command cannot be used for remote or virtual items.");
            }
            if (Directory.Exists(item.Path))
            {
                throw new ArgumentException("This command cannot be used for directories.");
            }

            return(ToStaticFileResult(item.Path));
        }