EDMI: UpdateFile WIP

This commit is contained in:
Jonathan Jenne
2022-01-25 16:29:20 +01:00
parent 0fa654bda0
commit 884c9d4546
18 changed files with 460 additions and 338 deletions

View File

@@ -0,0 +1,39 @@
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.EDMI.API.Options
Imports DigitalData.Modules.Logging
Namespace Modules.IDB
Public Class UpdateFile
Inherits BaseMethod
Public Sub New(pLogConfig As LogConfig, pChannel As IEDMIServiceChannel)
MyBase.New(pLogConfig, pChannel)
End Sub
Public Async Function RunAsync(pFilePath As String, pObjectId As Long, Optional pOptions As UpdateFileOptions = Nothing) As Task
' Set default options
If pOptions Is Nothing Then
pOptions = New UpdateFileOptions()
End If
' Check if file exists
If IO.File.Exists(pFilePath) = False Then
Throw New IO.FileNotFoundException("Path does not exist")
End If
' Importing the file now
Dim oFileProperties = Helpers.GetFileProperties(pFilePath, Date.Now)
'Dim oFileImportResponse = Await Channel.(New NewFileRequest With {
' .BusinessEntity = pBusinessEntity,
' .File = oFileProperties,
' .KindType = pObjectKind,
' .StoreName = pObjectStoreName,
' .User = New UserState With {
' .Language = pOptions.Language,
' .UserName = pOptions.Username
' }
'})
End Function
End Class
End Namespace