internal static bool IsPackageFile(System.IO.Packaging.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)) && !PackageHelper.IsManifest(path)); }
internal static bool IsPackageFile(ZipArchiveEntry part) { string path = part.FullName; // We exclude any opc files and the manifest file (.nuspec) return(!ExcludePaths.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase)) && !PackageHelper.IsManifest(path) && !path.StartsWith("[Content_Types]", StringComparison.OrdinalIgnoreCase)); }
internal static bool IsPackageFile(Uri uri) { string path = UriUtility.GetPath(uri); string directory = Path.GetDirectoryName(path); // We exclude any opc files and the manifest file (.nuspec) return(!ExcludePaths.Any(p => directory.StartsWith(p, StringComparison.OrdinalIgnoreCase)) && !PackageHelper.IsManifest(path)); }
private static void CreatePart(Package package, string path, Stream sourceStream) { if (!PackageHelper.IsManifest(path)) { Uri partUri = UriUtility.CreatePartUri(path); using (Stream stream = package.CreatePart(partUri, "application/octet", CompressionOption.Maximum).GetStream()) { sourceStream.CopyTo(stream); } } }
private static void CreatePart(ZipArchive package, string path, Stream sourceStream) { if (PackageHelper.IsManifest(path)) { return; } var entry = package.CreateEntry(path.Replace('\\', '/'), CompressionLevel.Optimal); using (var stream = entry.Open()) { sourceStream.CopyTo(stream); } }
private static void CreatePart(ZipArchive package, string path, Stream sourceStream) { if (PackageHelper.IsManifest(path)) { return; } var entry = package.CreateEntry(PathUtility.GetPathWithForwardSlashes(path), CompressionLevel.Optimal); using (var stream = entry.Open()) { sourceStream.CopyTo(stream); } }
private static void CreatePart(System.IO.Packaging.Package package, string path, Stream sourceStream) { if (PackageHelper.IsManifest(path)) { return; } Uri uri = UriUtility.CreatePartUri(path); // Create the part var packagePart = package.CreatePart(uri, DefaultContentType, System.IO.Packaging.CompressionOption.Maximum); using (Stream stream = packagePart.GetStream()) { sourceStream.CopyTo(stream); } }
internal static bool IsPackageFile(PackagePart part) { string path = UriUtility.GetPath(part.Uri); string directory = Path.GetDirectoryName(path); return(!Enumerable.Any <string>(ExcludePaths, p => directory.StartsWith(p, StringComparison.OrdinalIgnoreCase)) && !PackageHelper.IsManifest(path)); }
private IEnumerable <string> GetPackageFilePaths() { return(from p in _repositoryFileSystem.GetFiles(_packageName, "*.*", recursive: true) where !PackageHelper.IsManifest(p) && !PackageHelper.IsPackageFile(p) select p); }