EDMI Service: WIP

This commit is contained in:
Jonathan Jenne
2020-04-09 16:23:39 +02:00
parent 7abf47c2fc
commit bb9dd66d1f
20 changed files with 185 additions and 86 deletions

View File

@@ -55,12 +55,10 @@ Public Class Document
''' <returns>A document object</returns>
Public Async Function ImportFileAsync(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As Task(Of DocumentResult2)
Try
Dim oInfo As New FileInfo(FilePath)
Using oStream As New FileStream(FilePath, FileMode.Open)
Dim oContents As Byte() = {}
Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length)
Dim oResult = Await _channel.ImportFileAsync(oInfo, oContents, [ReadOnly], RetentionPeriod)
Dim oResult = Await _channel.ImportFileAsync(FilePath, oContents, Environment.UserName)
Return oResult
End Using
@@ -75,11 +73,11 @@ Public Class Document
''' </summary>
''' <param name="FilePath">The filename to import</param>
''' <returns>A document object</returns>
Public Function ImportFile(FilePath As String, Optional [ReadOnly] As Boolean = False, Optional RetentionPeriod As Integer = 0) As DocumentResult2
Public Function ImportFile(FilePath As String) As DocumentResult2
Try
Dim oContents As Byte() = File.ReadAllBytes(FilePath)
Dim oInfo As New FileInfo(FilePath)
Dim oDocObject = _channel.ImportFile(oInfo, oContents, [ReadOnly], RetentionPeriod)
Dim oDocObject = _channel.ImportFile(FilePath, oContents, Environment.UserName)
Return oDocObject
Catch ex As Exception
_logger.Error(ex)