Q: Example of how to execute IRepositoryClient.GetArchive()? #677
Unanswered
UsgsMonkey
asked this question in
Q&A
Replies: 1 comment
-
Hi @UsgsMonkey, Although NGitLab does offer async methods, RepositoryClient.GetArchive(tgzStream =>
{
using var gzip = new GZipStream(tgzStream, CompressionMode.Decompress);
using var unzippedStream = new MemoryStream();
gzip.CopyTo(unzippedStream);
unzippedStream.Seek(0, SeekOrigin.Begin);
using var reader = new TarReader(unzippedStream);
while (reader.GetNextEntry() is TarEntry entry)
{
Console.WriteLine($"Entry name: {entry.Name}, entry type: {entry.EntryType}");
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
I'm relatively new to asynchronous programming and am looking for guidance or links to proper guidance on how to code in the "Action<Stream>" argument input required by IRepositoryClient.GetArchive(). This seems to reference an async pattern and there's not documentation to lead the way. Any assistance would be a huge help as I stumble about trying to figure out the expected approach here. Ultimately, I'm trying to use NGitLab as a vehicle to download an archive (as a zip or other compressed format) to disk programmatically.
Warm Regards,
Brett
Beta Was this translation helpful? Give feedback.
All reactions