FilePath Class

Summary

Represents a file path.
Namespace
Cake.Core.IO
Base Types
graph BT Type-->Base0["Path"] click Base0 "/api/Cake.Core.IO/Path" Base0-->Base1["object"] Type["FilePath"] class Type type-node

Syntax

public sealed class FilePath : Path

Constructors

Name Summary
FilePath(string) Initializes a new instance of the FilePath class.

Properties

Name Value Summary
FullPath string
Gets the full path.
Inherited from Path
HasExtension bool
Gets a value indicating whether this path has a file extension.
IsRelative bool
Gets a value indicating whether or not this path is relative.
Inherited from Path
IsUNC bool
Gets a value indicating whether or not this path is an UNC path.
Inherited from Path
Segments string[]
Gets the segments making up the path.
Inherited from Path
Separator char
Gets the separator this path was normalized with.
Inherited from Path

Methods

Name Value Summary
AppendExtension(string) FilePath
Appends a file extension to the path.
ChangeExtension(string) FilePath
Changes the file extension of the path.
Collapse() FilePath
Collapses a FilePath containing ellipses.
FromString(string) FilePath
Performs a conversion from string to FilePath.
static
GetDirectory() DirectoryPath
Gets the directory part of the path.
GetExtension() string
Gets the file extension.
GetFilename() FilePath
Gets the filename.
GetFilenameWithoutExtension() FilePath
Gets the filename without its extension.
GetRelativePath(DirectoryPath) DirectoryPath
Get the relative path to another directory.
GetRelativePath(FilePath) FilePath
Get the relative path to another file.
MakeAbsolute(DirectoryPath) FilePath
Makes the path absolute (if relative) using the specified directory path.
MakeAbsolute(ICakeEnvironment) FilePath
Makes the path absolute (if relative) using the current working directory.
ToString() string
Returns a string that represents this path.
Inherited from Path

Operators

Name Value Summary
implicit operator FilePath(string) FilePath

Extension Methods

Name Value Summary
Dump<FilePath>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
ExpandEnvironmentVariables(ICakeEnvironment) FilePath
Expands all environment variables in the provided FilePath.
IsIn<FilePath>(FilePath[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<FilePath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<FilePath>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<FilePath>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<FilePath>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin