Changeset 33708 for gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java
- Timestamp:
- 2019-11-20T11:30:47+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java
r33664 r33708 15 15 public class ScanFile { 16 16 public static void printUsage(){ 17 System.err.println("Usage: ScanFile [ all]file");17 System.err.println("Usage: ScanFile [-all] api-key file"); 18 18 System.exit(1); 19 19 } 20 20 21 21 public static void main(String[] args) { 22 String apiKey = null; 22 23 String inputFileName = null; 24 23 25 boolean printall=false; 24 if (args.length<1 || args.length> 2){26 if (args.length<1 || args.length>3){ 25 27 printUsage(); 26 28 27 29 } 28 else if(args.length==2){ 29 if(args[0].equals("all")){ 30 inputFileName = args[1]; 30 else if(args.length==3){ 31 if(args[0].equals("-all")){ 32 apiKey = args[1]; 33 inputFileName = args[2]; 31 34 printall=true; 32 35 } … … 36 39 37 40 } 38 39 else{ 40 inputFileName = args[0]; 41 else if(args.length==2){ 42 apiKey = args[0]; 43 inputFileName = args[1]; 44 } 45 else { 46 printUsage(); 41 47 } 42 48 43 49 try { 44 50 45 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f"); 51 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey(apiKey); 52 46 53 VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl(); 47 54
Note:
See TracChangeset
for help on using the changeset viewer.