Package ariba.util.core

Examples of ariba.util.core.Date


    {
        Assert.that(minInterval >= 0 && minInterval < Date.MillisPerHour,
                    "minInterval must be positive and less than one hour");
       
        long currentTime = System.currentTimeMillis();
        Date date = new Date(currentTime);

        // If current time in recycle window, return minimum interval.
        int hour = Date.getHours(date);
        if (inRecycleWindow(hour)) {
            return minInterval;
        }
       
        // Set date to the recycle window begin hour on current day.  We add 1 second
        // to avoid rounding errors.  Compute interval to next begin time.  If begin hour
        // is before current time, interval will be negative, so add a day to adjust.
        Date.setHoursMinutesSeconds(date, recycleWindowBeginHour, 0, 1);
        long interval = date.getTime() - currentTime;
        interval = (interval >= 0) ? interval : interval + Date.MillisPerDay;
        Assert.assertNonFatal(interval >= 0, Fmt.S("Got negative interval %s", interval));
        // Add a random value between 0 and 10 minutes to make it less likely that two
        // nodes will try at the very beginning of the recycle window.
        interval += (new Random().nextInt(600)) * Date.MillisPerSecond;
 
View Full Code Here


        LogFile implements MoveTo since it should decide on the
        encoding scheme
    */
    boolean moveTo (File targetDirectory)
    {
        Date now = new Date();
        String logFileSaveName =
            Fmt.S("%s.%s-%02s-%02s_%02s.%02s.%02s.%s",
                  ArrayUtil.array(
                      this.prefix,
                      Constants.getInteger(Date.getYear(now)),
View Full Code Here

        return _currentObject.isDirectory();
    }

    public Date modifiedDate ()
    {
        return new Date(_currentObject.lastModified());
    }
View Full Code Here

TOP

Related Classes of ariba.util.core.Date

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.