This repository was archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
AD.IO.Compression
Austin Drenski edited this page Jan 31, 2017
·
5 revisions
UrlPath url = "www.google.com/example.zip";
ZipFilePath zip = ZipFilePath.Create("c:/users/example/desktop/example.zip");
url.GetZipFile(zip, overwrite: true);
UrlPath url = "www.google.com/example.zip";
ZipFilePath zip = ZipFilePath.Create("c:/users/example/desktop/example.zip");
url.TryGetZipFile(zip, overwrite: true, "Download successful");
// Console: Download successful
ZipFilePath zip = "c:/users/example/desktop/example.zip";
FilePath outFilePath = FilePath.Create("c:/users/example/desktop/example.txt");
zip.ExtractZipFile(outFilePath, overwrite: true, message: "'zip' extracted to 'outFilePath'");
// Console: 'zip' extracted to 'outFilePath'
ZipFilePath zip = "c:/users/example/desktop/example.zip";
ZipFilePath outZipFilePath = ZipFilePath.Create("c:/users/example/desktop/example.zip");
zip.ExtractZipFile(outZipFilePath, overwrite: true, message: "'zip' extracted to 'outZipFilePath'");
// Console: 'zip' extracted to 'outZipFilePath'
ZipFilePath zip = "c:/users/example/desktop/example.zip";
DelimitedFilePath outDelimitedFile = DelimitedFilePath.Create("c:/users/example/desktop/example.csv");
zip.ExtractZipFile(outDelimitedFile, overwrite: true, message: "'zip' extracted to 'outDelimitedFilePath'");
// Console: 'zip' extracted to 'outDelimitedFilePath'
ZipFilePath zip = "c:/users/example/desktop/example.zip";
XmlFilePath outXmlFilePath = XmlFilePath.Create("c:/users/example/desktop/example.xml");
zip.ExtractZipFile(outXmlFilePath, overwrite: true, message: "'zip' extracted to 'outXmlFilePath'");
// Console: 'zip' extracted to 'outXmlFilePath'
ZipFilePath zip = "c:/users/example/desktop/example.zip";
DirectoryPath directoryPath = "c:/users/example/desktop";
zip.ExtractZipFiles(directorPath, overwrite: true, message: "Contents of 'zip' extracted to 'outDirectoryPath'");
// Console: Contents of 'zip' extracted to 'outDirectoryPath'