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
stringThe path value. Could be relative or filename
Returns
GetAbsolutePath(string, string?)
Gets absolute path
public static string GetAbsolutePath(string path, string? defaultFolder)
Parameters
path
stringThe path value. Could be relative or filename
defaultFolder
stringThe folder path added to relative path in case the value is need to be corrected.
Returns
GetRelativePath(string)
Gets correct relative path
public static string GetRelativePath(string path)
Parameters
path
stringThe path value. Could be relative or absolute or filename
Returns
GetRelativePath(string, string?)
Gets correct relative path
public static string GetRelativePath(string path, string? defaultFolder)
Parameters
path
stringThe path value. Could be relative or absolute or filename
defaultFolder
stringThe folder path added to relative path in case the value is need to be corrected.
Returns
GetValidFileOrFolderName(string)
Sanitizes the given file or folder name, and replaces all illegal characters with '_'
public static string? GetValidFileOrFolderName(string name)
Parameters
name
stringThe 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
stringThe filename with path to validate
Returns
- bool
true
if filename and path is valid;false
otherwise.