Windream: use file versioning from Filesystem Module in VersionWMFilename
This commit is contained in:
parent
a423842423
commit
8ac01eefa4
@ -94,6 +94,7 @@ Public Class Windream
|
|||||||
#Region "Private Properties"
|
#Region "Private Properties"
|
||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
Private ReadOnly _logConfig As LogConfig
|
Private ReadOnly _logConfig As LogConfig
|
||||||
|
Private ReadOnly _fileSystem As Filesystem.File
|
||||||
Private ReadOnly _sessionDomain As String
|
Private ReadOnly _sessionDomain As String
|
||||||
Private ReadOnly _sessionPassword As String
|
Private ReadOnly _sessionPassword As String
|
||||||
Private ReadOnly _sessionUsername As String
|
Private ReadOnly _sessionUsername As String
|
||||||
@ -144,6 +145,7 @@ Public Class Windream
|
|||||||
' Create logger and save LogFactory for dependent classes
|
' Create logger and save LogFactory for dependent classes
|
||||||
_logger = LogConfig.GetLogger()
|
_logger = LogConfig.GetLogger()
|
||||||
_logConfig = LogConfig
|
_logConfig = LogConfig
|
||||||
|
_fileSystem = New Filesystem.File(LogConfig)
|
||||||
|
|
||||||
' Create a session
|
' Create a session
|
||||||
Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain)
|
Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain)
|
||||||
@ -1406,23 +1408,25 @@ Public Class Windream
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Public Function VersionWMFilename(pPath As String, pExt As String)
|
Public Function VersionWMFilename(pPath As String, pExt As String)
|
||||||
Dim rNewFilepath As String = pPath
|
Return _fileSystem.GetVersionedFilename(pPath)
|
||||||
pPath = GetNormalizedPath(pPath)
|
|
||||||
Dim oPath = pPath.Substring(0, pPath.LastIndexOf("\"))
|
'Dim rNewFilepath As String = pPath
|
||||||
Dim oFilename = pPath.Substring(pPath.LastIndexOf("\") + 1, pPath.Length - pPath.LastIndexOf("\") - 1)
|
'pPath = GetNormalizedPath(pPath)
|
||||||
Dim oCheck = oFilename
|
'Dim oPath = pPath.Substring(0, pPath.LastIndexOf("\"))
|
||||||
Dim oSplit As List(Of String) = oFilename.Split("~").ToList()
|
'Dim oFilename = pPath.Substring(pPath.LastIndexOf("\") + 1, pPath.Length - pPath.LastIndexOf("\") - 1)
|
||||||
oFilename = oFilename.Replace(pExt, "")
|
'Dim oCheck = oFilename
|
||||||
Dim oCount As Integer = 2
|
'Dim oSplit As List(Of String) = oFilename.Split("~").ToList()
|
||||||
Do While TestFileExists(rNewFilepath) = True
|
'oFilename = oFilename.Replace(pExt, "")
|
||||||
oFilename = oFilename.Replace(pExt, "")
|
'Dim oCount As Integer = 2
|
||||||
Dim oVersion = "~" + (oCount - 1).ToString
|
'Do While TestFileExists(rNewFilepath) = True
|
||||||
oFilename = oFilename.Replace(oVersion, "")
|
' oFilename = oFilename.Replace(pExt, "")
|
||||||
oFilename = oFilename & "~" & oCount & pExt
|
' Dim oVersion = "~" + (oCount - 1).ToString
|
||||||
oCount += 1
|
' oFilename = oFilename.Replace(oVersion, "")
|
||||||
rNewFilepath = oPath + "\" + oFilename
|
' oFilename = oFilename & "~" & oCount & pExt
|
||||||
Loop
|
' oCount += 1
|
||||||
Return rNewFilepath
|
' rNewFilepath = oPath + "\" + oFilename
|
||||||
|
'Loop
|
||||||
|
'Return rNewFilepath
|
||||||
End Function
|
End Function
|
||||||
Public Function TestFolderExists(Path As String) As Boolean
|
Public Function TestFolderExists(Path As String) As Boolean
|
||||||
Return TestObjectExists(GetNormalizedPath(Path), WMEntityFolder)
|
Return TestObjectExists(GetNormalizedPath(Path), WMEntityFolder)
|
||||||
|
|||||||
@ -136,6 +136,10 @@
|
|||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Modules.Filesystem\Filesystem.vbproj">
|
||||||
|
<Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project>
|
||||||
|
<Name>Filesystem</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Modules.Language\Language.vbproj">
|
<ProjectReference Include="..\Modules.Language\Language.vbproj">
|
||||||
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
|
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
|
||||||
<Name>Language</Name>
|
<Name>Language</Name>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user