コード例 #1
0
        public Task <object> Get(GetFile request)
        {
            var item = _libraryManager.GetItemById(request.Id);

            if (!item.IsFileProtocol)
            {
                throw new ArgumentException("This command cannot be used for remote or virtual items.");
            }
            if (_fileSystem.DirectoryExists(item.Path))
            {
                throw new ArgumentException("This command cannot be used for directories.");
            }

            return(ResultFactory.GetStaticFileResult(Request, item.Path));
        }
コード例 #2
0
        public object Get(GetFile request)
        {
            var item         = _libraryManager.GetItemById(request.Id);
            var locationType = item.LocationType;

            if (locationType == LocationType.Remote || 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));
        }
コード例 #3
0
        public Task <object> Get(GetFile request)
        {
            var item = _libraryManager.GetItemById(request.Id);

            return(ResultFactory.GetStaticFileResult(Request, item.Path));
        }