C# Class NuGet.MachineCache

The machine cache represents a location on the machine where packages are cached. It is a specific implementation of a local repository and can be used as such.
Inheritance: LocalPackageRepository
Show file Open project: xero-github/Nuget

Public Methods

Method Description
AddPackage ( IPackage package ) : void
Clear ( ) : void
Exists ( string packageId, SemanticVersion version ) : bool

Protected Methods

Method Description
GetPackageFilePath ( IPackage package ) : string
GetPackageFilePath ( string id, SemanticVersion version ) : string

Private Methods

Method Description
CreateDefault ( Func getCachePath ) : MachineCache

Creates a Machine Cache instance, assigns it to the instance variable and returns it.

GetCachePath ( ) : string

Determines the cache path to use for NuGet.exe. By default, NuGet caches files under %LocalAppData%\NuGet\Cache. This path can be overridden by specifying a value in the NuGetCachePath environment variable.

GetCachePath ( string>.Func getEnvironmentVariable, string>.Func getFolderPath ) : string
MachineCache ( IFileSystem fileSystem ) : System
TryAct ( System.Action action ) : void
TryClear ( IEnumerable files ) : void

Method Details

AddPackage() public method

public AddPackage ( IPackage package ) : void
package IPackage
return void

Clear() public method

public Clear ( ) : void
return void

Exists() public method

public Exists ( string packageId, SemanticVersion version ) : bool
packageId string
version SemanticVersion
return bool

GetPackageFilePath() protected method

protected GetPackageFilePath ( IPackage package ) : string
package IPackage
return string

GetPackageFilePath() protected method

protected GetPackageFilePath ( string id, SemanticVersion version ) : string
id string
version SemanticVersion
return string