Table of Contents

Class PathUtilities

Namespace
Alternet.Common
Assembly
Alternet.Common.v10.dll

Contains Path related methods.

public static class PathUtilities
Inheritance
PathUtilities

Properties

DynamicLibraryExtension

Gets or sets the dynamic library extension based on the current operating system.

TempPathOverride

Gets or sets the override path for the temporary folder returned by GetTempPath().

UseAppSubFolderAsTempPath

Gets or sets a value indicating whether the application should use a subfolder within the application folder as the temporary path.

Methods

AddDirectorySeparatorChar(string?)

Adds directory separator char to the path if it's needed. If path already has directory separator char at the end, no changes are performed.

DeleteAllContents(string)

Deletes all contents of the specified folder, including files and subdirectories.

DeleteAllContentsInTempFolder()

Deletes all contents of the temporary folder, including files and subdirectories.

DeleteFiles(string?, string)

Deletes files in the specified folder that match the given search pattern.

DeleteFilesInTempFolder(string?)

Deletes files in the temporary folder that match the specified search pattern.

EndsWithDirectorySeparator(string?)

Returns boolean value indicating whether path ends with directory separator char.

ExtractDirectorySeparatorChar(string?)

Returns directory separator char which is used in given path.

GenTempFileName(string, GenTempFileNameFlags)

Generates a temporary file name with the specified extension.

GetAppFolder()

Returns path to the application folder.

GetExactPath(string)

Gets the exact case used on the file system for an existing file or directory.

GetFileNameWithoutAllExtensions(string)

Removes all extensions from the path, i.e "aaa.png.zip" -> "aaa"

GetLibraryExtension()

Gets dynamic library extension depending on the current operating system.

GetTempFileName()

Generates a temporary file name in the temporary directory returned by GetTempPath().

GetTempPath()

Returns the path to the temporary folder.

GetTempPathUniquePerApp()

Generates a unique temporary path for the application.

IsDirectorySeparator(char)

Determines whether the specified character is a directory separator character.

IsPathFullyQualified(string)

Indicates whether given path is a fully qualified path location.

IsPathPartiallyQualified(string)

Indicates whether a given path is not a fully qualified path location.

IsPathRelative(string, string)

Determines directory or its sub-directories contains the file.

IsPathValid(string?)

Indicates whether a given path contains only characters for path names.

MakeRelativePath(string, string)

Creates a relative path from one file or folder to another.

NormalizePath(string)

Brings the given the path to a common normal form.

NormalizePathSeparators(string)

Replaces alternative separators by regular ones in given path.

OpenFolderInFileExplorer(string)

Opens the specified folder in the file explorer of the current operating system.

TryGetExactPath(string, out string?)

Gets the exact case used on the file system for an existing file or directory.