Exemple #1
0
 private IEnumerable <string> GetPackageFilePaths()
 {
     return(from p in _repositoryFileSystem.GetFiles(_packagePath, "*.*", recursive: true)
            where !PackageHelper.IsUnzippedPackageManifest(p, Id, Version) &&
            !PackageHelper.IsPackageManifest(p, Id) &&
            !PackageHelper.IsPackageFile(p)
            select p);
 }
Exemple #2
0
        internal static bool IsPackageFile(PackagePart part, string packageId)
        {
            string path      = UriUtility.GetPath(part.Uri);
            string directory = Path.GetDirectoryName(path);

            // We exclude any opc files and the auto-generated package manifest file ({packageId}.nuspec)
            return(!ExcludePaths.Any(p => directory.StartsWith(p, StringComparison.OrdinalIgnoreCase)) &&
                   !PackageHelper.IsPackageManifest(path, packageId));
        }
Exemple #3
0
        private static void CreatePart(Package package, string path, Stream sourceStream)
        {
            if (PackageHelper.IsPackageManifest(path, package.PackageProperties.Identifier))
            {
                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);
            }
        }