add readonly, retentionperiod for EDMIAPI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user