List of usage examples for org.apache.commons.lang3.text WordUtils WordUtils
public WordUtils()
WordUtils
instances should NOT be constructed in standard programming.
From source file:org.owasp.dependencycheck.reporting.ReportGenerator.java
/** * Constructs the velocity context used to generate the dependency-check * reports.//from w w w . j a v a 2s. com * * @param applicationName the application name being analyzed * @param dependencies the list of dependencies * @param analyzers the list of analyzers used * @param properties the database properties (containing timestamps of the * NVD CVE data) * @return the velocity context */ 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("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; }