EDMI: changes in newfile and updatefile method
This commit is contained in:
@@ -138,26 +138,12 @@ Namespace IDB
|
||||
|
||||
Public Function GetFileObjectPath(pStore As GlobalState.ObjectStore, pDateImported As Date) As String
|
||||
' Get directory by DateImported or, if not supplied, by current date
|
||||
Dim oSubDirectory As String
|
||||
Dim oFinalPath As String
|
||||
If IsNothing(pDateImported) Then
|
||||
oSubDirectory = FileEx.CreateDateDirectory(Now)
|
||||
oFinalPath = FileEx.CreateDateDirectory(pStore.Path, Now)
|
||||
Else
|
||||
oSubDirectory = FileEx.CreateDateDirectory(pDateImported)
|
||||
oFinalPath = FileEx.CreateDateDirectory(pStore.Path, pDateImported)
|
||||
End If
|
||||
Logger.Debug("Subdirectory is [{0}]", oSubDirectory)
|
||||
|
||||
' Check and create final path, if necessary
|
||||
Dim oFinalPath = IO.Path.Combine(pStore.Path, oSubDirectory)
|
||||
If Not IO.Directory.Exists(oFinalPath) Then
|
||||
Try
|
||||
Logger.Debug("Path does not exist, creating: [{0}]", oFinalPath)
|
||||
IO.Directory.CreateDirectory(oFinalPath)
|
||||
Logger.Debug("Created folder [{0}]", oFinalPath)
|
||||
Catch ex As Exception
|
||||
LogAndThrow(ex, $"Store Directory [{oFinalPath}] could not be created!")
|
||||
End Try
|
||||
End If
|
||||
Logger.Debug("Final Directory is [{0}]", oFinalPath)
|
||||
|
||||
Return oFinalPath
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user