Windream: fix NormalizePath
This commit is contained in:
parent
068f660451
commit
f04c5ec4b0
@ -766,6 +766,12 @@ Public Class Windream
|
|||||||
Public Function GetNormalizedPath(Path As String) As String
|
Public Function GetNormalizedPath(Path As String) As String
|
||||||
Dim oNormalizedPath = GetCleanedPath(Path)
|
Dim oNormalizedPath = GetCleanedPath(Path)
|
||||||
Try
|
Try
|
||||||
|
' Convert any forward slashes / and double slashes \\ into backslashes \
|
||||||
|
' See: https://stackoverflow.com/questions/3144492/how-do-i-get-nets-path-combine-to-convert-forward-slashes-to-backslashes
|
||||||
|
If IsPathRooted(oNormalizedPath) Then
|
||||||
|
oNormalizedPath = GetFullPath(oNormalizedPath)
|
||||||
|
End If
|
||||||
|
|
||||||
' Remove Driveletter, eg. W:\
|
' Remove Driveletter, eg. W:\
|
||||||
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
|
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
|
||||||
_logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]")
|
_logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]")
|
||||||
@ -775,13 +781,9 @@ Public Class Windream
|
|||||||
' Remove Windream Base Path, eg. \\windream\objects\
|
' Remove Windream Base Path, eg. \\windream\objects\
|
||||||
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
|
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
|
||||||
_logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]")
|
_logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]")
|
||||||
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length - 1)
|
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Convert any forward slashes / and double slashes \\ into backslashes \
|
|
||||||
' See: https://stackoverflow.com/questions/3144492/how-do-i-get-nets-path-combine-to-convert-forward-slashes-to-backslashes
|
|
||||||
oNormalizedPath = GetFullPath(oNormalizedPath)
|
|
||||||
|
|
||||||
' Handle misconfigured drive-letter
|
' Handle misconfigured drive-letter
|
||||||
If oNormalizedPath.Contains(":") Then
|
If oNormalizedPath.Contains(":") Then
|
||||||
_logger.Warn($"oNormalizedPath still contains a drive name!!")
|
_logger.Warn($"oNormalizedPath still contains a drive name!!")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user