Index: /gs2-extensions/malware-checker/trunk/java/pom.xml
===================================================================
--- /gs2-extensions/malware-checker/trunk/java/pom.xml	(revision 33664)
+++ /gs2-extensions/malware-checker/trunk/java/pom.xml	(revision 33664)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.greenstone.virustotal</groupId>
+  <artifactId>malware-checker</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>malware-checker</name>
+  <url>http://www.greenstone.org</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>com.github.vatbub</groupId>
+      <artifactId>VirustotalPublicV2.0</artifactId>
+      <version>1.1.rB</version>
+    </dependency>
+
+  </dependencies>
+  
+
+
+  <build>
+    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
+      <plugins>
+        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
+        <plugin>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>3.1.0</version>
+        </plugin>
+        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.8.0</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.22.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.5.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <version>2.8.2</version>
+        </plugin>
+        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.7.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-project-info-reports-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+	<plugin>
+	  <artifactId>maven-assembly-plugin</artifactId>
+	  <configuration>
+            <archive>
+              <manifest>
+		<mainClass>org.greenstone.virustotal.ScanFile</mainClass>
+              </manifest>
+            </archive>
+            <descriptorRefs>
+              <descriptorRef>jar-with-dependencies</descriptorRef>
+            </descriptorRefs>
+	  </configuration>
+	</plugin>
+
+	<plugin>
+	  <artifactId>maven-assembly-plugin</artifactId>
+	  <configuration>
+            <archive>
+              <manifest>
+		<mainClass>org.greenstone.virustotal.GetFileScanReport</mainClass>
+              </manifest>
+            </archive>
+            <descriptorRefs>
+              <descriptorRef>jar-with-dependencies</descriptorRef>
+            </descriptorRefs>
+	  </configuration>
+	</plugin>
+
+	<plugin>
+	  <artifactId>maven-assembly-plugin</artifactId>
+	  <configuration>
+            <archive>
+              <manifest>
+		<mainClass>org.greenstone.virustotal.ScanFile</mainClass>
+              </manifest>
+            </archive>
+            <descriptorRefs>
+              <descriptorRef>jar-with-dependencies</descriptorRef>
+            </descriptorRefs>
+	  </configuration>
+	</plugin>
+
+	<plugin>
+	  <artifactId>maven-assembly-plugin</artifactId>
+	  <configuration>
+            <archive>
+              <manifest>
+		<mainClass>org.greenstone.virustotal.addComment</mainClass>
+              </manifest>
+            </archive>
+            <descriptorRefs>
+              <descriptorRef>jar-with-dependencies</descriptorRef>
+            </descriptorRefs>
+	  </configuration>
+	</plugin>
+
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
Index: /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/AddComment.java
===================================================================
--- /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/AddComment.java	(revision 33664)
+++ /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/AddComment.java	(revision 33664)
@@ -0,0 +1,43 @@
+package org.greenstone.virustotal;
+import com.kanishka.virustotal.dto.GeneralResponse;
+import com.kanishka.virustotal.exception.APIKeyNotFoundException;
+import com.kanishka.virustotal.exception.UnauthorizedAccessException;
+import com.kanishka.virustotalv2.VirusTotalConfig;
+import com.kanishka.virustotalv2.VirustotalPublicV2;
+import com.kanishka.virustotalv2.VirustotalPublicV2Impl;
+
+import java.io.UnsupportedEncodingException;
+
+public class AddComment {
+    public static void main(String[] args) {
+
+        try {
+            VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f");
+            VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl();
+
+            String resourceID = null;
+	    String comment = null;	
+	    resourceID = args[0];
+            comment = args[1];
+	
+            GeneralResponse gRespo = virusTotalRef.makeAComment(resourceID, comment);
+
+            System.out.println("Response Code : " + gRespo.getResponseCode());
+            System.out.println("Verbose Message : " + gRespo.getVerboseMessage());
+
+        } catch (APIKeyNotFoundException ex) {
+            System.err.println("API Key not found! " + ex.getMessage());
+		System.exit(1);
+        } catch (UnsupportedEncodingException ex) {
+	    System.err.println("Unsupported Encoding Format!" + ex.getMessage());
+	    	System.exit(2);
+        } catch (UnauthorizedAccessException ex) {
+            System.err.println("Invalid API Key " + ex.getMessage());
+		System.exit(3);
+        } catch (Exception ex) {
+            System.err.println("Something Bad Happened! " + ex.getMessage());
+		System.exit(4);
+        }
+    }
+
+}
Index: /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ApiDetails.java
===================================================================
--- /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ApiDetails.java	(revision 33664)
+++ /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ApiDetails.java	(revision 33664)
@@ -0,0 +1,5 @@
+package org.greenstone.virustotal;
+
+public class ApiDetails {
+    public static final String API_KEY = "09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f";
+}
Index: /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/GetFileScanReport.java
===================================================================
--- /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/GetFileScanReport.java	(revision 33664)
+++ /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/GetFileScanReport.java	(revision 33664)
@@ -0,0 +1,65 @@
+package org.greenstone.virustotal;
+import com.kanishka.virustotal.dto.FileScanReport;
+import com.kanishka.virustotal.dto.VirusScanInfo;
+import com.kanishka.virustotal.exception.APIKeyNotFoundException;
+import com.kanishka.virustotal.exception.UnauthorizedAccessException;
+import com.kanishka.virustotalv2.VirusTotalConfig;
+import com.kanishka.virustotalv2.VirustotalPublicV2;
+import com.kanishka.virustotalv2.VirustotalPublicV2Impl;
+
+import java.io.*;
+import java.util.*; 
+import java.lang.*; 
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class GetFileScanReport {
+	
+
+    public static void main(String[] args) {
+        try {
+            VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f");
+            VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl();
+	
+	    String resourceID = null;
+	    resourceID = args[0];
+            FileScanReport report = virusTotalRef.getScanReport(resourceID);
+
+            System.out.println("MD5 :\t" + report.getMd5());
+            System.out.println("Perma link :\t" + report.getPermalink());
+            System.out.println("Resource :\t" + report.getResource());
+            System.out.println("Scan Date :\t" + report.getScanDate());
+            System.out.println("Scan Id :\t" + report.getScanId());
+            System.out.println("SHA1 :\t" + report.getSha1());
+            System.out.println("SHA256 :\t" + report.getSha256());
+            System.out.println("Verbose Msg :\t" + report.getVerboseMessage());
+            System.out.println("Response Code :\t" + report.getResponseCode());
+            System.out.println("Positives :\t" + report.getPositives());
+            System.out.println("Total :\t" + report.getTotal());
+
+            Map<String, VirusScanInfo> scans = report.getScans();
+            for (String key : scans.keySet()) {
+                VirusScanInfo virusInfo = scans.get(key);
+                System.out.println("Scanner : " + key);
+                System.out.println("\t\t Resut : " + virusInfo.getResult());
+                System.out.println("\t\t Update : " + virusInfo.getUpdate());
+                System.out.println("\t\t Version :" + virusInfo.getVersion());
+            }
+
+        } catch (APIKeyNotFoundException ex) {
+            System.err.println("API Key not found! " + ex.getMessage());
+	    System.exit(1);
+        } catch (UnsupportedEncodingException ex) {
+            System.err.println("Unsupported Encoding Format!" + ex.getMessage());
+	    System.exit(2);
+        } catch (UnauthorizedAccessException ex) {
+            System.err.println("Invalid API Key " + ex.getMessage());
+	    System.exit(3);
+        } catch (Exception ex) {
+            System.err.println("Something Bad Happened! " + ex.getMessage());
+	    System.exit(4);
+        }
+    }
+}
Index: /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java
===================================================================
--- /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java	(revision 33664)
+++ /gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java	(revision 33664)
@@ -0,0 +1,88 @@
+package org.greenstone.virustotal;
+import com.kanishka.virustotal.dto.ScanInfo;
+import com.kanishka.virustotal.exception.APIKeyNotFoundException;
+import com.kanishka.virustotal.exception.UnauthorizedAccessException;
+import com.kanishka.virustotalv2.VirusTotalConfig;
+import com.kanishka.virustotalv2.VirustotalPublicV2;
+import com.kanishka.virustotalv2.VirustotalPublicV2Impl;
+import java.io.*;
+import java.util.*; 
+import java.lang.*;   
+import java.io.UnsupportedEncodingException;
+
+
+
+public class ScanFile {
+    public static void printUsage(){
+		System.err.println("Usage: ScanFile [all] file");
+		System.exit(1);
+	}
+
+    public static void main(String[] args) {
+	String inputFileName = null;
+	boolean printall=false;
+  	if (args.length<1 || args.length>2){
+		printUsage();
+
+	}
+	else if(args.length==2){
+		if(args[0].equals("all")){
+			inputFileName = args[1];
+			printall=true;
+		}
+		else{
+			printUsage();		
+		}
+	        
+	}
+	
+ 	else{
+		inputFileName = args[0];
+	}
+
+	try {
+	
+            VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f");
+            VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl();
+
+            ScanInfo scanInformation = virusTotalRef.scanFile(new File(inputFileName));
+	    int responseCode = scanInformation.getResponseCode();
+	    if(responseCode!=1){
+		System.err.println("Error:Failed to preform scan.");		
+		System.out.println("Verbose Msg :\t" + scanInformation.getVerboseMessage());
+		System.exit(6);
+	    }
+	    if (printall){
+	    	System.out.println("___SCAN INFORMATION___");
+            	System.out.println("MD5 :\t" + scanInformation.getMd5());
+            	System.out.println("Perma Link :\t" + scanInformation.getPermalink());
+            	System.out.println("Resource :\t" + scanInformation.getResource());
+            	System.out.println("Scan Date :\t" + scanInformation.getScanDate());
+            	System.out.println("Scan Id :\t" + scanInformation.getScanId());
+            	System.out.println("SHA1 :\t" + scanInformation.getSha1());
+            	System.out.println("SHA256 :\t" + scanInformation.getSha256());
+            	System.out.println("Verbose Msg :\t" + scanInformation.getVerboseMessage());
+            	System.out.println("Response Code :\t" + scanInformation.getResponseCode());
+           	System.out.println("done.");
+
+	    }
+
+	    else {
+		System.out.println(scanInformation.getResource());
+	    }
+       
+        } catch (APIKeyNotFoundException ex) {
+            System.err.println("API Key not found! " + ex.getMessage());
+		System.exit(2);
+        } catch (UnsupportedEncodingException ex) {
+            System.err.println("Unsupported Encoding Format!" + ex.getMessage());
+		System.exit(3);
+        } catch (UnauthorizedAccessException ex) {
+            System.err.println("Invalid API Key " + ex.getMessage());
+	    	System.exit(4);
+        } catch (Exception ex) {
+            System.err.println("Something Bad Happened! " + ex.getMessage());
+		System.exit(5);
+        }
+    }
+}
