/** * Scan a file from a given {@link InputStream}. * * @param in * @param filename * @return An {@link ArrayList} of {@link VictimsRecord}s derrived from the source. Embedded jars * are a record on their own. * @throws IOException */ public static ArrayList<VictimsRecord> getRecords(InputStream in, String filename) throws IOException { ArrayList<VictimsRecord> records = new ArrayList<VictimsRecord>(); Artifact artifact = Processor.process(in, filename); scanArtifact(artifact, new ArrayOutputStream(records)); return records; }
/** * Scans a provided {@link File} producing {@link VictimsRecord}. The string values of the * resulting records will be written to the specified output stream. * * @param file * @param os * @throws IOException */ private static void scanFile(File file, VictimsOutputStream vos) throws IOException { File f = file; String path = f.getAbsolutePath(); Artifact artifact = Processor.process(path); scanArtifact(artifact, vos); }