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)); }
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)); }
public Task <object> Get(GetFile request) { var item = _libraryManager.GetItemById(request.Id); return(ResultFactory.GetStaticFileResult(Request, item.Path)); }