try { final byte[] fileContent = IOUtils.toByteArray(new FileInputStream(dependency.getActualFile())); final ScannerFacade scanner = new ScannerFacade(jsRepository); final List<JsLibraryResult> results = scanner.scanScript(dependency.getActualFile().getAbsolutePath(), fileContent, 0);
/** * Obtain the singleton instance. It make sure the repo is loaded the first time. * @return Will always return the same instance * @throws IOException Unable to load the repository */ public static ScannerFacade getInstance() throws IOException { if(instance == null) { instance = new ScannerFacade(); } return instance; }
public static ScannerFacade loadInstance(VulnerabilitiesRepository repo) throws IOException { if(instance == null) { instance = new ScannerFacade(repo); } return instance; }
try { final byte[] fileContent = IOUtils.toByteArray(new FileInputStream(dependency.getActualFile())); final ScannerFacade scanner = new ScannerFacade(jsRepository); final List<JsLibraryResult> results = scanner.scanScript(dependency.getActualFile().getAbsolutePath(), fileContent, 0);