Search Results for

    Show / Hide Table of Contents
    View Source

    Class PackageMigrationResource

    Provides utility methods for accessing embedded package migration resources.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Packaging
    Assembly: Umbraco.Core.dll
    Syntax
    public static class PackageMigrationResource

    Methods

    View Source

    GetEmbeddedPackageDataManifest(Type)

    Gets the embedded package data manifest from the specified plan type.

    Declaration
    public static XDocument? GetEmbeddedPackageDataManifest(Type planType)
    Parameters
    Type Name Description
    Type planType

    The type of the migration plan to get the embedded package from.

    Returns
    Type Description
    XDocument

    The package XML document, or null if no embedded package was found.

    View Source

    GetEmbeddedPackageDataManifest(Type, out ZipArchive?)

    Gets the embedded package data manifest from the specified plan type.

    Declaration
    public static XDocument? GetEmbeddedPackageDataManifest(Type planType, out ZipArchive? zipArchive)
    Parameters
    Type Name Description
    Type planType

    The type of the migration plan to get the embedded package from.

    ZipArchive zipArchive

    When this method returns, contains the zip archive if the package is a zip file; otherwise, null.

    Returns
    Type Description
    XDocument

    The package XML document, or null if no embedded package was found.

    View Source

    GetEmbeddedPackageDataManifestHash(Type)

    Gets a hash of the embedded package data manifest for the specified plan type.

    Declaration
    public static string GetEmbeddedPackageDataManifestHash(Type planType)
    Parameters
    Type Name Description
    Type planType

    The type of the migration plan.

    Returns
    Type Description
    string

    A hash string representing the package contents.

    Exceptions
    Type Condition
    IOException

    Thrown when no embedded package files are found for the plan type.

    View Source

    GetPackageDataManifest(Stream, out XDocument)

    Gets the package data manifest from a zip stream.

    Declaration
    public static ZipArchive GetPackageDataManifest(Stream packageZipStream, out XDocument packageXml)
    Parameters
    Type Name Description
    Stream packageZipStream

    The zip stream containing the package.

    XDocument packageXml

    When this method returns, contains the package XML document.

    Returns
    Type Description
    ZipArchive

    The opened System.IO.Compression.ZipArchive for the package.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when packageZipStream is null.

    InvalidOperationException

    Thrown when the zip package does not contain the required package.xml file.

    View Source

    TryGetEmbeddedPackageDataManifest(Type, out XDocument?, out ZipArchive?)

    Attempts to get the embedded package data manifest from the specified plan type.

    Declaration
    public static bool TryGetEmbeddedPackageDataManifest(Type planType, out XDocument? packageXml, out ZipArchive? zipArchive)
    Parameters
    Type Name Description
    Type planType

    The type of the migration plan.

    XDocument packageXml

    When this method returns, contains the package XML document if found; otherwise, null.

    ZipArchive zipArchive

    When this method returns, contains the zip archive if the package is a zip file; otherwise, null.

    Returns
    Type Description
    bool

    true if an embedded package was found; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX