2 Commits

Author SHA1 Message Date
Jonathan Jenne
e61f85c4cc Windream: Version 1.0.0.7 2020-05-29 13:56:37 +02:00
Jonathan Jenne
f04c5ec4b0 Windream: fix NormalizePath 2020-05-29 13:56:27 +02:00
2 changed files with 8 additions and 6 deletions

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.6")>
<Assembly: AssemblyVersion("1.0.0.7")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -766,6 +766,12 @@ Public Class Windream
Public Function GetNormalizedPath(Path As String) As String
Dim oNormalizedPath = GetCleanedPath(Path)
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:\
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
_logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]")
@@ -775,13 +781,9 @@ Public Class Windream
' Remove Windream Base Path, eg. \\windream\objects\
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
_logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]")
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length - 1)
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length)
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
If oNormalizedPath.Contains(":") Then
_logger.Warn($"oNormalizedPath still contains a drive name!!")