EDMI: Fix DoctypeId Parameter

This commit is contained in:
Jonathan Jenne
2022-03-29 13:35:20 +02:00
parent 665a23d8a7
commit 615666f040
17 changed files with 178 additions and 187 deletions

View File

@@ -3,17 +3,18 @@ Imports DigitalData.Modules.Logging
Public Class Helpers
Private ReadOnly LogConfig As LogConfig
Private ReadOnly Logger As Logger
Private ReadOnly FileEx As Filesystem.File
Private ReadOnly LogConfig As LogConfig
Private ReadOnly Logger As Logger
Private ReadOnly FileEx As Filesystem.File
Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(pLogConfig)
End Sub
Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(pLogConfig)
End Sub
Public Function GetFileProperties(pFilePath As String, pDateImportedAt As Date) As FileProperties
Public Function GetFileProperties(pFilePath As String, pDateImportedAt As Date) As FileProperties
Try
Using oFileStream As New IO.FileStream(pFilePath, IO.FileMode.Open, IO.FileAccess.Read)
Using oMemoryStream As New IO.MemoryStream()
oFileStream.CopyTo(oMemoryStream)
@@ -27,16 +28,21 @@ Public Class Helpers
Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
Dim oFileHash As String = FileEx.GetChecksum(oFileInfo.FullName)
Return New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pDateImportedAt,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
Return New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pDateImportedAt,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
}
End Using
End Using
End Using
End Function
End Class
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class