Class PackageMigrationResource
Provides utility methods for accessing embedded package migration resources.
Inheritance
Namespace: Umbraco.Cms.Core.Packaging
Assembly: Umbraco.Core.dll
Syntax
public static class PackageMigrationResource
Methods
View SourceGetEmbeddedPackageDataManifest(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 |
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, |
Returns
| Type | Description |
|---|---|
| XDocument | The package XML document, or |
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. |
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 |
| InvalidOperationException | Thrown when the zip package does not contain the required package.xml file. |
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, |
| ZipArchive | zipArchive | When this method returns, contains the zip archive if the package is a zip file; otherwise, |
Returns
| Type | Description |
|---|---|
| bool |
|