EDMI Service: WIP
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user