private VelocityContext createContext ( String applicationName , List < Dependency > dependencies , List < Analyzer > analyzers , DatabaseProperties properties ) { final DateTime dt = new DateTime ( ) ; final DateTimeFormatter dateFormat = DateTimeFormat . forPattern ( "MMM d, yyyy 'at' HH:mm:ss z" ) ; final DateTimeFormatter dateFormatXML = DateTimeFormat . forPattern ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) ; final String scanDate = dateFormat . print ( dt ) ; final String scanDateXML = dateFormatXML . print ( dt ) ; final VelocityContext ctxt = new VelocityContext ( ) ; ctxt . put ( "applicationName" , applicationName ) ; ctxt . put ( "dependencies" , dependencies ) ; ctxt . put ( "analyzers" , analyzers ) ; ctxt . put ( "properties" , properties ) ; ctxt . put ( "scanDate" , scanDate ) ; ctxt . put ( "scanDateXML" , scanDateXML ) ; ctxt . put ( "enc" , new EscapeTool ( ) ) ; ctxt . put ( "rpt" , new ReportTool ( ) ) ; ctxt . put ( "WordUtils" , new WordUtils ( ) ) ; ctxt . put ( "VENDOR" , EvidenceType . VENDOR ) ; ctxt . put ( "PRODUCT" , EvidenceType . PRODUCT ) ; ctxt . put ( "VERSION" , EvidenceType . VERSION ) ; ctxt . put ( "version" , settings . getString ( Settings . KEYS . APPLICATION_VERSION , "Unknown" ) ) ; return ctxt ; }
Constructs the velocity context used to generate the dependency - check reports .