Changeset 33716
- Timestamp:
- 2019-11-22T10:43:02+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
r33708 r33716 22 22 String apiKey = null; 23 23 String inputFileName = null; 24 String outputFileName = null; 24 25 25 26 boolean printall=false; … … 47 48 } 48 49 50 //outputFileName = ".virustotal-resource-id-" + inputFileName; 51 outputFileName = inputFileName + "-VIRUSTOTAL-RESOURCEID"; 52 49 53 try { 50 54 … … 60 64 System.exit(6); 61 65 } 62 if (printall) {66 if (printall) { 63 67 System.out.println("___SCAN INFORMATION___"); 64 68 System.out.println("MD5 :\t" + scanInformation.getMd5()); … … 74 78 75 79 } 80 else { 81 String resource_id = scanInformation.getResource(); 82 83 System.out.println(resource_id); 76 84 77 else { 78 System.out.println(scanInformation.getResource()); 85 PrintWriter writer = new PrintWriter(outputFileName, "UTF-8"); 86 writer.println(resource_id); 87 writer.close(); 79 88 } 80 89 … … 88 97 System.err.println("Invalid API Key " + ex.getMessage()); 89 98 System.exit(4); 99 } catch (IOException ex) { 100 System.err.println("IO error:" + ex.getMessage()); 101 System.exit(5); 90 102 } catch (Exception ex) { 91 103 System.err.println("Something Bad Happened! " + ex.getMessage()); 92 System.exit( 5);104 System.exit(6); 93 105 } 94 106 }
Note:
See TracChangeset
for help on using the changeset viewer.