package io.sensesecure.clamav4j;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Represents a ClamAV version. The ClamAV database is versioned in two ways - the version number and the version time. Users of this class can choose their
 * preferred field of antivirus database versioning.
 */
public class ClamAVVersion {
    /** Version of the ClamAV client. */
    private final String clamAvVersion;
    /** Number of the database version. Higher number means newer version. */
    private final long databaseVersion;
    /** Time when the database was updated. Higher number means newer version. */
    private final Date databaseTime;

    /**
     * Constructor.
     * 
     * @param status Response from the clamd VERSION command. Contains '/'-separated version of the clamAV client, database and database timestamp.
     */
    public ClamAVVersion(String clamdResponse) {
        String[] split = clamdResponse.split("\\/");
        this.clamAvVersion = split[0];
        this.databaseVersion = Long.parseLong(split[1]);
        try {
            this.databaseTime = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.ENGLISH).parse(split[2]);
        } catch (ParseException e) {
            throw new IllegalArgumentException(e);
        }
    }

    /**
     * @return Version of the ClamAV client.
     */
    public String getClamAvVersion() {
        return clamAvVersion;
    }

    /**
     * @return Number of the database version. Higher number means newer version.
     */
    public long getDatabaseVersion() {
        return databaseVersion;
    }

    /**
     * @return Time when the database was updated. Higher number means newer version.
     */
    public Date getDatabaseTime() {
        return databaseTime;
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
        return "ClamAVVersion [clamAvVersion=" + clamAvVersion + ", databaseVersion=" + databaseVersion + ", databaseTime=" + databaseTime + "]";
    }
}

@@ -234,16 +234,20 @@
 o ways -
+%0D%0A *
  the ver
@@ -407,23 +407,33 @@
 sion %7B%0D%0A
+%0D%0A
     /**
+%0D%0A     *
  Version
@@ -454,16 +454,22 @@
  client.
+%0D%0A    
  */%0D%0A   
@@ -513,16 +513,24 @@
 %0A    /**
+%0D%0A     *
  Number 
@@ -580,32 +580,38 @@
 s newer version.
+%0D%0A    
  */%0D%0A    private
@@ -647,16 +647,24 @@
 %0A    /**
+%0D%0A     *
  Time wh
@@ -726,16 +726,22 @@
 version.
+%0D%0A    
  */%0D%0A   
@@ -813,17 +813,16 @@
 %0D%0A     *
- 
 %0D%0A     *
@@ -833,14 +833,21 @@
 ram 
-status
+clamdResponse
  Res
@@ -892,16 +892,24 @@
 Contains
+%0D%0A     *
  '/'-sep
@@ -966,16 +966,24 @@
 database
+%0D%0A     *
  timesta
@@ -1655,32 +1655,40 @@
 mber means newer
+%0D%0A     *
  version.%0D%0A     
@@ -1850,32 +1850,40 @@
 mber means newer
+%0D%0A     *
  version.%0D%0A     
@@ -1969,16 +1969,24 @@
 %0A    /**
+%0D%0A     *
  %7B@inher
@@ -1991,16 +1991,67 @@
 eritDoc%7D
+%0D%0A     *%0D%0A     * @return ClamAVVersion String%0D%0A    
  */%0D%0A   

Fix param issue in ClamAVVersion.