add readonly, retentionperiod for EDMIAPI

This commit is contained in:
Jonathan Jenne
2020-02-04 16:37:19 +01:00
parent 97806fe9cd
commit 338cec6859
5 changed files with 20 additions and 14 deletions

View File

@@ -237,7 +237,7 @@ Public Class IDBService
#End Region
#Region "Document"
Public Function ImportFile(FileInfo As FileInfo, Contents() As Byte) As DocumentResult2 Implements IIDBService.ImportFile
Public Function ImportFile(FileInfo As FileInfo, Contents() As Byte, [Readonly] As Boolean, RetentionPeriod As Integer) As DocumentResult2 Implements IIDBService.ImportFile
Dim oFilePath = Path.Combine(AppConfig.ContainerPath, FileInfo.Name)
Dim oDocument = New DocumentResult2.DocumentObject() With {.FileName = FileInfo.Name}
@@ -251,11 +251,15 @@ Public Class IDBService
Dim oAttributes = IO.File.GetAttributes(oFilePath) Or FileAttributes.ReadOnly
_logger.Info("Setting LastAccessTime")
IO.File.SetLastAccessTime(oFilePath, Date.Now.AddYears(30))
If RetentionPeriod Then
_logger.Info("Setting LastAccessTime")
IO.File.SetLastAccessTime(oFilePath, Date.Now.AddYears(30))
End If
_logger.Info("Setting ReadOnly Attribute")
IO.File.SetAttributes(oFilePath, oAttributes)
If [Readonly] Then
_logger.Info("Setting ReadOnly Attribute")
IO.File.SetAttributes(oFilePath, oAttributes)
End If
Return New DocumentResult2(oDocument)
Catch ex As Exception

View File

@@ -43,7 +43,7 @@ Interface IIDBService
#Region "Document (New)"
<OperationContract>
Function ImportFile(FileInfo As FileInfo, Contents As Byte()) As DocumentResult2
Function ImportFile(FileInfo As FileInfo, Contents As Byte(), [ReadOnly] As Boolean, RetentionTime As Integer) As DocumentResult2
#End Region
#Region "Utils"