Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
630 changes: 318 additions & 312 deletions mapping.json

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions src/Microsoft.PackageManagement.ArchiverProviders/CabArchiver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

namespace Microsoft.PackageManagement.Archivers.Internal {
using System;
using System.Collections.Generic;
using PackageManagement.Internal;
using PackageManagement.Internal.Implementation;

public class CabArchiver {
private static readonly Dictionary<string, string[]> _features = new Dictionary<string, string[]> {
{Constants.Features.SupportedExtensions, new[] {"cab", "msu"}},
{Constants.Features.MagicSignatures, new[] {Constants.Signatures.Cab}}
};

/// <summary>
/// Returns a collection of strings to the client advertizing features this provider supports.
/// </summary>
/// <param name="request">
/// An object passed in from the CORE that contains functions that can be used to interact with
/// the CORE and HOST
/// </param>
public void GetFeatures(Request request) {
if( request == null ) {
throw new ArgumentNullException("request");
}

// Nice-to-have put a debug message in that tells what's going on.
request.Debug("Calling '{0}::GetFeatures' ", ArchiverName);
foreach (var feature in _features) {
request.Yield(feature);
}
}

/// <summary>
/// Returns the name of the Provider.
/// </summary>
/// <returns></returns>
public string ArchiverName {
get { return "cabfile"; }
}

/// <summary>
/// Returns the version of the Provider.
/// </summary>
/// <returns>The version of this provider </returns>
public string ProviderVersion {
get {
return "1.0.0.0";
}
}

public IEnumerable<string> UnpackArchive(string localFilename, string destinationFolder, Request request) {
return null;
}

public bool IsSupportedFile(string localFilename) {
return false;
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//---------------------------------------------------------------------
// <copyright file="ArchiveException.cs" company="Microsoft Corporation">
// Copyright (c) 1999, Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>
// Part of the Deployment Tools Foundation project.
// </summary>
//---------------------------------------------------------------------

namespace Microsoft.PackageManagement.Archivers.Internal.Compression
{
using System;
using System.IO;

/// <summary>
/// Base exception class for compression operations. Compression libraries should
/// derive subclass exceptions with more specific error information relevent to the
/// file format.
/// </summary>
public class ArchiveException : IOException
{
/// <summary>
/// Creates a new ArchiveException with a specified error message and a reference to the
/// inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="innerException">The exception that is the cause of the current exception. If the
/// innerException parameter is not a null reference (Nothing in Visual Basic), the current exception
/// is raised in a catch block that handles the inner exception.</param>
public ArchiveException(string message, Exception innerException)
: base(message, innerException)
{
}

/// <summary>
/// Creates a new ArchiveException with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ArchiveException(string message)
: this(message, null)
{
}

/// <summary>
/// Creates a new ArchiveException.
/// </summary>
public ArchiveException()
: this(null, null)
{
}

}
}
Loading