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)); }
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)); }