public object Any(GetArchive request) { if (string.IsNullOrEmpty(request.RequestId)) { throw new ArgumentNullException(nameof(request.RequestId)); } var tmpPath = Path.Combine(ProtocConfig.TempDirectory, request.RequestId, "out"); if (!Directory.Exists(tmpPath)) { throw HttpError.NotFound("Temporary archive no longer exists"); } var tmpZipPath = Path.Combine(ProtocConfig.TempDirectory, request.RequestId, request.FileName ?? "grpc.zip"); if (!File.Exists(tmpZipPath)) { ZipFile.CreateFromDirectory(tmpPath, tmpZipPath); } return(new HttpResult(new FileInfo(tmpZipPath), asAttachment: true)); }
public void SetUp() { Query = new GetArchive(); Prefix = new Uri("https://api.github.com"); }