Package org.zanata.exception

Examples of org.zanata.exception.InvalidDateParamException


            throw new NoSuchEntityException(username);
        }

        String[] dateRange = dateRangeParam.split("\\.\\.");
        if (dateRange.length != 2) {
            throw new InvalidDateParamException(dateRangeParam);
        }

        Date fromDate, toDate;

        try {
            fromDate = DateUtil.getDate(dateRange[0], DATE_FORMAT);
            toDate = DateUtil.getDate(dateRange[1], DATE_FORMAT);

            fromDate = DateUtil.getStartOfDay(fromDate);
            toDate = DateUtil.getEndOfTheDay(toDate);

            if (fromDate.after(toDate) || !DateUtil.isDatesInRange(fromDate,
                    toDate, MAX_STATS_DAYS)) {
                throw new InvalidDateParamException(dateRangeParam);
            }
        } catch (IllegalArgumentException e) {
            throw new InvalidDateParamException(dateRangeParam);
        }

        LocaleStatistics localeStatistics = new LocaleStatistics();

        List<Object[]> data =
View Full Code Here

TOP

Related Classes of org.zanata.exception.InvalidDateParamException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.