Table of Contents

Class FilePathHelper

Namespace
Dynamicweb.Core.Helpers
Assembly
Dynamicweb.Core.dll
public static class FilePathHelper
Inheritance
FilePathHelper
Inherited Members

Methods

GetAbsolutePath(string)

Gets absolute path

public static string GetAbsolutePath(string path)

Parameters

path string

The path value. Could be relative or filename

Returns

string

GetAbsolutePath(string, string?)

Gets absolute path

public static string GetAbsolutePath(string path, string? defaultFolder)

Parameters

path string

The path value. Could be relative or filename

defaultFolder string

The folder path added to relative path in case the value is need to be corrected.

Returns

string

GetRelativePath(string)

Gets correct relative path

public static string GetRelativePath(string path)

Parameters

path string

The path value. Could be relative or absolute or filename

Returns

string

GetRelativePath(string, string?)

Gets correct relative path

public static string GetRelativePath(string path, string? defaultFolder)

Parameters

path string

The path value. Could be relative or absolute or filename

defaultFolder string

The folder path added to relative path in case the value is need to be corrected.

Returns

string

GetValidFileOrFolderName(string)

Sanitizes the given file or folder name, and replaces all illegal characters with '_'

public static string? GetValidFileOrFolderName(string name)

Parameters

name string

The file or folder name which should be sanitized.

Returns

string

The sanitized file or folder name which only contains legal characters

ValidateFilename(string)

Validates the given filename with path.

public static bool ValidateFilename(string fileNameWithPath)

Parameters

fileNameWithPath string

The filename with path to validate

Returns

bool

true if filename and path is valid; false otherwise.

To top