Zooflow: EDMI Service WIP
This commit is contained in:
@@ -176,6 +176,59 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'Public Function ImportFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pBusinessEntity As String, Optional pImportOptions As NewFileOptions = Nothing)
|
||||
' Try
|
||||
' ' Set default options
|
||||
' If pImportOptions Is Nothing Then
|
||||
' pImportOptions = New NewFileOptions()
|
||||
' End If
|
||||
|
||||
' ' Check if file exists
|
||||
' If File.Exists(pFilePath) = False Then
|
||||
' Throw New FileNotFoundException("Path does not exist")
|
||||
' End If
|
||||
|
||||
' Dim oFileInfo As New FileInfo(pFilePath)
|
||||
' Dim oExtension As String = oFileInfo.Extension
|
||||
|
||||
' Dim oFileName As String = oFileInfo.Name
|
||||
' Dim oFileCreatedAt As Date = oFileInfo?.CreationTime
|
||||
' Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
|
||||
' Dim oFileHash As String = _FileEx.GetChecksum(oFileInfo.FullName)
|
||||
|
||||
' ' Importing the file now
|
||||
' Using oFileStream As New FileStream(pFilePath, FileMode.Open, FileAccess.Read)
|
||||
' Using oMemoryStream As New MemoryStream()
|
||||
' oFileStream.CopyTo(oMemoryStream)
|
||||
' Dim oContents = oMemoryStream.ToArray()
|
||||
|
||||
' Dim oFileImportResponse = Await _channel.NewFIleAsync (New NewFileRequest With {
|
||||
' .BusinessEntity = pBusinessEntity,
|
||||
' .File = New FileProperties With {
|
||||
' .FileName = oFileInfo.Name,
|
||||
' .FileCreatedAt = oFileCreatedAt,
|
||||
' .FileChangedAt = oFileModifiedAt,
|
||||
' .FileContents = oContents,
|
||||
' .FileImportedAt = pImportOptions.DateImported,
|
||||
' .FileChecksum = oFileHash
|
||||
' },
|
||||
' .KindType = pObjectKind,
|
||||
' .StoreName = pObjectStoreName,
|
||||
' .Who = pImportOptions.Username
|
||||
' })
|
||||
' If oFileImportResponse.OK = False Then
|
||||
' Throw New ApplicationException("Could not Import File Contents!")
|
||||
' End If
|
||||
|
||||
' Return oFileImportResponse.ObjectId
|
||||
' End Using
|
||||
' End Using
|
||||
' Catch ex As Exception
|
||||
' _logger.Error(ex)
|
||||
' Return INVALID_OBEJCT_ID
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
''' <summary>
|
||||
''' Sets a value to an attribute
|
||||
''' </summary>
|
||||
|
||||
Reference in New Issue
Block a user