CKFinder 3 – ASP.NET Connector Documentation
Path Class Reference

A collection of helper methods for manipulating paths. More...

Static Public Member Functions

static string Combine (string basePath, params string[] paths)
 Combines multiple path parts into one. More...
 
static string GetParentPath (string path)
 Returns parent path name for the given path. More...
 
static string GetFolderName (string path)
 Gets the folder name. More...
 
static string GetFileName (string path)
 Gets file name for given path. More...
 
static string GetFileNameWithoutExtension (string path)
 Gets file name without extension for given path. More...
 
static string GetExtension (string path)
 Gets the extension of a file for given path. More...
 
static bool IsFileNameValid (string fileName)
 Determines wheter file name is valid. More...
 
static bool IsFolderNameValid (string folderName)
 Determines wheter folder name is valid. More...
 
static bool IsPathValid (string path)
 Determines wheter path is valid. More...
 
static bool IsFolder (string path)
 Checks whether a path points to a folder. More...
 
static bool IsAbsolute (string path)
 Checks whether a path is absolute. More...
 

Static Public Attributes

const char ExtensionChar = '.'
 The character used for separating file name and extension. More...
 
const char Separator = '/'
 The character used for separating path parts. More...
 
const char AlternativeSeparator = '\\'
 The alternative character used for separating path parts. More...
 
static readonly string SeparatorString = Separator.ToString()
 The string used for separating path parts. More...
 
static readonly IReadOnlyCollection< string > InvalidNames
 The collection of invalid file and folder names. More...
 
static IReadOnlyCollection< char > InvalidFileNameChars
 The collection of invalid file name characters. More...
 
static IReadOnlyCollection< char > InvalidPathChars
 The collection of invalid path characters. More...
 
static IReadOnlyCollection< char > InvalidFolderNameChars => InvalidPathChars.Concat(new[] { Separator }).ToArray()
 The collection of invalid folder name characters. More...
 

Detailed Description

A collection of helper methods for manipulating paths.

Member Function Documentation

◆ Combine()

static string Combine ( string  basePath,
params string[]  paths 
)
inlinestatic

Combines multiple path parts into one.

Parameters
basePathA base path.
pathsA path segments added to base path.
Returns
A combined path.

◆ GetExtension()

static string GetExtension ( string  path)
inlinestatic

Gets the extension of a file for given path.

Parameters
pathA path to the file.
Returns
An extension.

◆ GetFileName()

static string GetFileName ( string  path)
inlinestatic

Gets file name for given path.

Parameters
pathA path to the file.
Returns
A file name.

◆ GetFileNameWithoutExtension()

static string GetFileNameWithoutExtension ( string  path)
inlinestatic

Gets file name without extension for given path.

Parameters
pathA path to the file.
Returns
A file name without extension.

◆ GetFolderName()

static string GetFolderName ( string  path)
inlinestatic

Gets the folder name.

Given path must point to the folder.

Parameters
pathA path to folder.
Returns
A folder name.

◆ GetParentPath()

static string GetParentPath ( string  path)
inlinestatic

Returns parent path name for the given path.

Parameters
pathA path for which parent will be returned.
Returns
A parent path.

◆ IsAbsolute()

static bool IsAbsolute ( string  path)
inlinestatic

Checks whether a path is absolute.

Parameters
pathA path to check.
Returns
True if path is absolute, false otherwise.

◆ IsFileNameValid()

static bool IsFileNameValid ( string  fileName)
inlinestatic

Determines wheter file name is valid.

Parameters
fileNameA file name to check.
Returns
True if file name is valid, false otherwise.

◆ IsFolder()

static bool IsFolder ( string  path)
inlinestatic

Checks whether a path points to a folder.

Parameters
pathA path to check.
Returns
True if path is a folder, false otherwise.

◆ IsFolderNameValid()

static bool IsFolderNameValid ( string  folderName)
inlinestatic

Determines wheter folder name is valid.

Parameters
folderNameA folder name to check.
Returns
True if folder name is valid, false otherwise.

◆ IsPathValid()

static bool IsPathValid ( string  path)
inlinestatic

Determines wheter path is valid.

Parameters
pathA path to check.
Returns
True if path is valid, false otherwise.

Member Data Documentation

◆ AlternativeSeparator

const char AlternativeSeparator = '\\'
static

The alternative character used for separating path parts.

◆ ExtensionChar

const char ExtensionChar = '.'
static

The character used for separating file name and extension.

◆ InvalidFileNameChars

IReadOnlyCollection<char> InvalidFileNameChars
static

The collection of invalid file name characters.

◆ InvalidFolderNameChars

IReadOnlyCollection<char> InvalidFolderNameChars => InvalidPathChars.Concat(new[] { Separator }).ToArray()
static

The collection of invalid folder name characters.

◆ InvalidNames

readonly IReadOnlyCollection<string> InvalidNames
static
Initial value:
= new[]
{
"CON",
"PRN",
"AUX",
"CLOCK$",
"NUL",
"COM1",
"COM2",
"COM3",
"COM4",
"COM5",
"COM6",
"COM7",
"COM8",
"COM9",
"LPT1",
"LPT2",
"LPT3",
"LPT4",
"LPT5",
"LPT6",
"LPT7",
"LPT8",
"LPT9"
}

The collection of invalid file and folder names.

◆ InvalidPathChars

IReadOnlyCollection<char> InvalidPathChars
static

The collection of invalid path characters.

◆ Separator

const char Separator = '/'
static

The character used for separating path parts.

See also
SeparatorString

◆ SeparatorString

readonly string SeparatorString = Separator.ToString()
static

The string used for separating path parts.

See also
Separator

The documentation for this class was generated from the following file: