IsManifest() публичный статический Метод

public static IsManifest ( string path ) : bool
path string
Результат bool
Пример #1
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));
        }
Пример #2
0
 protected override IEnumerable <IPackageFile> GetFilesBase()
 {
     return(from p in _repositoryFileSystem.GetFiles(_packageName, "*.*", recursive: true)
            where !PackageUtility.IsManifest(p)
            select new PhysicalPackageFile
     {
         SourcePath = _repositoryFileSystem.GetFullPath(p),
         TargetPath = p.Substring(_packageName.Length + 1)                   // only count from the package root
     });
 }
Пример #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
 public IEnumerable <IPackageFile> GetFiles()
 {
     return(_packageBuilder.Files.Where(p => !PackageUtility.IsManifest(p.Path)));
 }
Пример #5
0
        protected virtual void ExecuteUninstall(IPackage package)
        {
            string packageDirectory        = PathResolver.GetPackageDirectory(package);
            PackageOperationEventArgs args = CreateOperation(package);

            OnUninstalling(args);

            if (args.Cancel)
            {
                return;
            }

            OnRemoveFiles(args);

            // Only remove nupkg and nuspec if the package directory is otherwise empty.
            // The DeleteOnRestartManager will use the nupkg to determine whether files are left in the package directory
            // directory because files were added or modified as opposed to locked.
            if (!FileSystem.GetDirectoriesSafe(packageDirectory).Any() &&
                FileSystem.GetFilesSafe(packageDirectory).All(f => PackageUtility.IsPackageFile(f) || PackageUtility.IsManifest(f)))
            {
                LocalRepository.RemovePackage(package);
            }

            Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyUninstalledPackage, package.GetFullName());

            OnUninstalled(args);
        }
Пример #6
0
 private IEnumerable <string> GetPackageFilePaths()
 {
     return(from p in _repositoryFileSystem.GetFiles(_packageName, "*.*", recursive: true)
            where !PackageUtility.IsManifest(p) && !PackageUtility.IsPackageFile(p)
            select p);
 }