package io.sidecar.util;

import org.apache.commons.lang.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

import java.text.ParseException;

public class DateUtils {

    public static DateTime nowUtc() {
        return new DateTime(DateTimeZone.UTC);
    }

    /**
     * Test if a date is older than a certain number of minutes.
     *
     * @param requestDateTimeAsString - the date to check against
     * @param minutesAgo              - the number of minutes to check against
     * @return - true if the request date is older than the number of minutes passed in
     */
    @SuppressWarnings("unused")
    public static boolean isExpiredRequestDate(String requestDateTimeAsString, int minutesAgo)
            throws ParseException {

        if (StringUtils.isBlank(requestDateTimeAsString)) {
            return true;
        }

        DateTime requestDateTime = new DateTime(requestDateTimeAsString, DateTimeZone.UTC);
        DateTime timeOutThreshold = nowUtc().minusMinutes(minutesAgo);

        // if the header date is older than this, fail
        return requestDateTime.isBefore(timeOutThreshold);
    }
}

@@ -189,17 +189,16 @@
 Utils %7B%0A
-%0A
     publ
@@ -289,862 +289,30 @@
     
-/**%0A     * Test if a date is older than a certain number of minutes.%0A     *%0A     * @param requestDateTimeAsString - the date to check against%0A     * @param minutesAgo              - the number of minutes to check against%0A     * @return - true if the request date is older than the number of minutes passed in%0A     */%0A    @SuppressWarnings(%22unused%22)%0A    public static boolean isExpiredRequestDate(String requestDateTimeAsString, int minutesAgo)%0A            throws ParseException %7B%0A%0A        if (StringUtils.isBlank(requestDateTimeAsString)) %7B%0A            return true;%0A        %7D%0A%0A        DateTime requestDateTime = new DateTime(requestDateTimeAsString, DateTimeZone.UTC);%0A        DateTime timeOutThreshold = nowUtc().minusMinutes(minutesAgo);%0A%0A        // if the header date is older than this, fail%0A        return requestDateTime.isBefore(timeOutThreshold);
+private DateUtils() %7B%0A
 %0A   

remove isExpiredRequestDate