Class PackageContentsHelper

Namespace
Datamine.MineTrustConnector.Core
Assembly
Datamine.MineTrustConnector.Core.dll

Utility class providing operations for managing the contents of individual instances of PackageConfiguration. Provides mechanisms for manipulating the inclusion and exclusion manifests of the configuration, as well as mechanisms for evaluating a given instance's definition against the user's local machine.

public static class PackageContentsHelper
Inheritance
PackageContentsHelper
Inherited Members

Methods

EnumerateLocalContents(PackageConfiguration)

Enumerates the contents of this package with respect to the local machine.

public static IEnumerable<string?> EnumerateLocalContents(PackageConfiguration packageConfiguration)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

Returns

IEnumerable<string>

The enumerated local results.

Exceptions

InvalidOperationException

Package local root cannot be null or Package MineTrust root cannot be null

EnumerateLocalFilesByTag(PackageConfiguration, string, string?)

Enumerates the contents of this package with respect to the local machine, filtering by those results which matched the specified tag criterion.

public static IEnumerable<string?> EnumerateLocalFilesByTag(PackageConfiguration packageConfiguration, string tagName, string? tagValue)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

tagName string

Name of the tag.

tagValue string

The tag value.

Returns

IEnumerable<string>

The enumerated local results.

ExcludeFromPackage(PackageConfiguration, string)

Modifies the Include and Exclude manifests of the package configuration so that the specified local file is excluded from the package. Note that this method does not implicitly evaluate the package against the local file system.

public static PackageConfiguration ExcludeFromPackage(PackageConfiguration packageConfiguration, string localFilePath)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

localFilePath string

The local file path.

Returns

PackageConfiguration

The package configuration

IncludeInPackage(PackageConfiguration, string, Func<IncludeConfiguration, IncludeConfiguration>?)

Modifies the Include and Exclude manifests of the package configuration so that the specified local file is included in the package. Optionally supplies a parameter to configure the IncludeConfiguration of the corresponding manifest entry. Note that this method does not implicitly evaluate the package against the local file system.

public static PackageConfiguration IncludeInPackage(PackageConfiguration packageConfiguration, string localFilePath, Func<IncludeConfiguration, IncludeConfiguration>? configureInclusion = null)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

localFilePath string

The local file path.

configureInclusion Func<IncludeConfiguration, IncludeConfiguration>

The inclusion callback.

Returns

PackageConfiguration

The package configuration

IsInScope(PackageConfiguration, string)

Determines whether or not the specified local file is in the scope of the package configuration.

public static bool IsInScope(PackageConfiguration packageConfiguration, string localFilePath)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

localFilePath string

The local file path.

Returns

bool

true if [is in scope] [the specified package configuration]; otherwise, false.

TagFile(PackageConfiguration, string, string, string?)

Updates the manifest of the package configuration so that the specified local file is adorned with the tagName and tagValue specified. A null tagValue removes that tag if present.

public static PackageConfiguration TagFile(PackageConfiguration packageConfiguration, string localFilePath, string tagName, string? tagValue)

Parameters

packageConfiguration PackageConfiguration

The package configuration.

localFilePath string

The local file path.

tagName string

Name of the tag.

tagValue string

The tag value.

Returns

PackageConfiguration

The package configuration