Integrating an existing virus scanner - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

You can integrate an existing virus scanner application in SmartPlant Foundation Web Client to communicate with the system by implementing the IVirusScanner interface located at:

Intergraph.SPF.Server.API.Files.Interfaces namespace

This requires you to add a reference to the Intergraph.SPF.Server.API.dll, which is located at:

C:\Program Files (x86)\SmartPlant\Foundation\SPFServer\bin\Intergraph.SPF.Server.API.dll

The IVirusScanner interface has one method, IsFileVirus. This method takes in a temporary upload path for the file and returns a boolean value that indicates whether the scanned file contains a virus

Example implementation

[Export(typeof(IVirusScanner)), PartCreationPolicy(CreationPolicy.NonShared)

public class ExampleVirusScanner : IVirusScanner

{

public bool IsFileVirus(string pstrFilePath)

     {

          return PurchasedVirusScanner.ScanFile(pstrFilePath);

}

}