示例#1
0
        private static bool IsPackageFile(ZipArchiveEntry entry)
        {
            // We exclude any opc files and the manifest file (.nuspec)
            var path = entry.FullName;

            return(!path.EndsWith("/") && !ExcludePaths.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase)) &&
                   !PackageUtility.IsManifest(path));
        }
示例#2
0
        private static bool IsPackageFile(PackagePart part)
        {
            string path = UriUtility.GetPath(part.Uri);

            // We exclude any opc files and the manifest file (.nuspec)
            return(!ExcludePaths.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase)) &&
                   !PackageUtility.IsManifest(path));
        }
示例#3
0
        private static void CreatePart(Package package, string path, Stream sourceStream)
        {
            if (PackageUtility.IsManifest(path))
            {
                return;
            }

            Uri uri = UriUtility.CreatePartUri(path);

            // Create the part
            PackagePart packagePart = package.CreatePart(uri, DefaultContentType, CompressionOption.Maximum);

            using (Stream stream = packagePart.GetStream())
            {
                sourceStream.CopyTo(stream);
            }
        }
示例#4
0
        private bool IsPackageFile(string path, PackageArchiveReader reader)
        {
            // We exclude any opc files and the manifest file (.nuspec)

            // check for signature here as a hack until we have API support in nuget
            if (path.StartsWith(".signature"))
            {
                IsSigned = true;
                using (var ms = new MemoryStream())
                    using (var str = reader.GetStream(path))
                    {
                        str.CopyTo(ms);
                        PopulateSignatureProperties(ms.ToArray());
                    }
            }

            return(!path.EndsWith("/") && !ExcludePaths.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase)) &&
                   !PackageUtility.IsManifest(path));
        }
 public IEnumerable <IPackageFile> GetFiles()
 {
     return(_packageBuilder.Files.Where(p => !PackageUtility.IsManifest(p.Path)));
 }