C# Class Ntent.PowerShell.Providers.Consul.ConsulProvider

Inheritance: System.Management.Automation.Provider.NavigationCmdletProvider
Show file Open project: ntent-ad/consul-ps-provider

Private Properties

Property Type Description
ChunkPath string[]
ConsulProvider System
IsSamePath bool
MakeKey string
NewCache void
NormalizePath string
PathIsDrive bool
PathsFromWildCard string[]
RemoveDriveFromPath string
TrimEndSeparator string
TrimSeparator string
TrimStartSeparator string

Protected Methods

Method Description
CopyItem ( string path, string copyPath, bool recurse ) : void
CopyItem ( string path, string copyPath, bool recurse, bool deleteSrc ) : void
ExpandPath ( string path ) : string[]
GetChildItems ( string path, bool recurse ) : void
GetItem ( string path ) : void
HasChildItems ( string path ) : bool
IsItemContainer ( string path ) : bool

Checks whether the specified path is a "container". In Consul, there is really no notion of container other than by convention the key ends in a trailing slash. when navigating the PS provider, we don't want to force people to have to end paths with a trailing slash, so we will by default be lenient on whether the path requested ends with a trailing slash.

IsItemContainer ( string path, bool exact ) : bool

Checks whether the specified path is a "container". If the 'exact' parameter is passed as true, the path must end in a trailing slash. This form is called from the Get-Item and Get-ChildItems methods when sending back whether that item is a container. This must be done because in Consul you can have both ./container and ./container/ where the former is not a container, but the latter is.

IsValidPath ( string path ) : bool
ItemExists ( string path ) : bool
MoveItem ( string path, string destination ) : void
NewDrive ( System.Management.Automation.PSDriveInfo drive ) : System.Management.Automation.PSDriveInfo
NewItem ( string path, string itemTypeName, object newItemValue ) : void
RemoveItem ( string path, bool recurse ) : void
SetItem ( string path, object value ) : void

Private Methods

Method Description
ChunkPath ( string path ) : string[]

Breaks up the path into individual elements.

ConsulProvider ( ) : System
IsSamePath ( string path1, string path2 ) : bool
MakeKey ( string path, string action ) : string
NewCache ( ) : void
NormalizePath ( string path ) : string

Adapts the path, making sure the correct path separator character is used.

PathIsDrive ( string path ) : bool

Checks if a given path is actually a drive name.

PathsFromWildCard ( string path ) : string[]
RemoveDriveFromPath ( string path ) : string

Ensures that the drive is removed from the specified path

TrimEndSeparator ( string path ) : string
TrimSeparator ( string path ) : string
TrimStartSeparator ( string path ) : string

Method Details

CopyItem() protected method

protected CopyItem ( string path, string copyPath, bool recurse ) : void
path string
copyPath string
recurse bool
return void

CopyItem() protected method

protected CopyItem ( string path, string copyPath, bool recurse, bool deleteSrc ) : void
path string
copyPath string
recurse bool
deleteSrc bool
return void

ExpandPath() protected method

protected ExpandPath ( string path ) : string[]
path string
return string[]

GetChildItems() protected method

protected GetChildItems ( string path, bool recurse ) : void
path string
recurse bool
return void

GetItem() protected method

protected GetItem ( string path ) : void
path string
return void

HasChildItems() protected method

protected HasChildItems ( string path ) : bool
path string
return bool

IsItemContainer() protected method

Checks whether the specified path is a "container". In Consul, there is really no notion of container other than by convention the key ends in a trailing slash. when navigating the PS provider, we don't want to force people to have to end paths with a trailing slash, so we will by default be lenient on whether the path requested ends with a trailing slash.
protected IsItemContainer ( string path ) : bool
path string
return bool

IsItemContainer() protected method

Checks whether the specified path is a "container". If the 'exact' parameter is passed as true, the path must end in a trailing slash. This form is called from the Get-Item and Get-ChildItems methods when sending back whether that item is a container. This must be done because in Consul you can have both ./container and ./container/ where the former is not a container, but the latter is.
protected IsItemContainer ( string path, bool exact ) : bool
path string
exact bool
return bool

IsValidPath() protected method

protected IsValidPath ( string path ) : bool
path string
return bool

ItemExists() protected method

protected ItemExists ( string path ) : bool
path string
return bool

MoveItem() protected method

protected MoveItem ( string path, string destination ) : void
path string
destination string
return void

NewDrive() protected method

protected NewDrive ( System.Management.Automation.PSDriveInfo drive ) : System.Management.Automation.PSDriveInfo
drive System.Management.Automation.PSDriveInfo
return System.Management.Automation.PSDriveInfo

NewItem() protected method

protected NewItem ( string path, string itemTypeName, object newItemValue ) : void
path string
itemTypeName string
newItemValue object
return void

RemoveItem() protected method

protected RemoveItem ( string path, bool recurse ) : void
path string
recurse bool
return void

SetItem() protected method

protected SetItem ( string path, object value ) : void
path string
value object
return void