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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public ZipPackager(Archive archive)
 {
   _archive = archive;
 }