private static Archive MakeArchiveFor(NewProjectVersion newProjectVersion) { Archive archive = new Archive(); Purl commonRootDirectory = newProjectVersion.FileSet.FindCommonDirectory(); foreach (FileSystemFile file in newProjectVersion.FileSet.Files) { archive.Add(file.Path.ChangeRoot(commonRootDirectory), file); } return archive; }
public static Archive ReadZip(Purl path) { ZipFile zip = new ZipFile(path.AsString); Archive archive = new Archive(path, zip); foreach (ZipEntry entry in zip) { if (!entry.IsDirectory) { Purl entryPath = new Purl(entry.Name); ArchivedFileInZip fileInZip = new ArchivedFileInZip(entryPath, zip, entry); ManifestEntry manifestEntry = new ManifestEntry(entryPath, fileInZip); archive.Add(manifestEntry); } } return archive; }
public ZipPackager(Archive archive) { _archive = archive; }