Using the Virus Scan Provider API
Use
The interfaces and classes of the Virus Scan Provider API are in the package com.sap.security.core.server.vsi.api of the facade tc~bl~vsi~api.
In the development environment (IDE), you need to set a runtime reference to the facade tc~bl~vsi~api in the development project.
To use the Virus Scan Provider, you need to set this up.
The four most frequently used objects are presented below. These are also contained in the Example Program for the Virus Scan Provider.
The most important interfaces of the Virus Scan Provider API are VSIService and Instance. You can use the methods of VSIService to access external virus scan products that are certified by SAP. The available methods of the VSIService interface include:
-
addProfile
-
getGroup
-
getGroups
-
getInstance
-
getInstanceByGroup
-
getInstanceByProvider
-
getProfile
-
getProfiles
-
getProvider
-
getProviders
-
releaseInstance
External users of this API can use the methods of the interface Instance to return one of the following instances: Profile, Group, or Provider (Adapter or Server). The available methods of the Instance interface include:
-
cleanBytes
-
cleanFile
-
getCleanedLength
-
getJobID
-
getLastErrorRC
-
getParameter
-
getParameters
-
scanBytes
-
scanBytesEx
-
scanFile
-
scanStream
-
setDefaultConfig
-
setJobID
-
setParameter
-
setScanInfo
-
getContentInfo
The most important classes of the Virus Scan Provider API are Infection, ScanError, and ContentInfo. The class Infection contains the characteristics of a virus infection that has occurred. Since this information is returned by the external anti-virus software, it depends on the respective product. The available methods include:
-
getFreeTextInfo
-
getObjectName
-
getObjectSize
-
getVirusId
-
getVirusName
-
isRepairable
The ScanError class contains the characteristics of an error that has occurred during a virus check. Since this information is returned by the external anti-virus software, it depends on the respective product. The available methods include:
-
getErrorRC
-
getErrorText
-
getObjectName
-
getObjectSize
The class ContentInfo contains the characteristics of the binary object. The scanner needs to evaluate it, and to return a value if the parameter CUST_CHECK_MIME_TYPE is set to 1. The available methods include:
-
getContentType
-
getExtension
-
getObjectName
For more information, see SAP Note 817623
and the JavaDocs for the relevant interfaces and classes.