Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* *********************************************************************
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0.
  * 
  * If a copy of the MPL was not distributed with this file, You can obtain
  * one at http://mozilla.org/MPL/2.0/.
  * 
  * This Source Code Form is "Incompatible With Secondary Licenses", as
  * defined by the Mozilla Public License, v. 2.0.
 * ********************************************************************* */
package fiftyone.mobile.detection;

Class Run by the Timer object in the Factory51D Object. Used to prompt an update in the Factory class.

Author(s):
51Degrees.mobi
Version:
2.2.8.9
public class AutoUpdater extends java.util.TimerTask {

    
The factory used to construct the updater.
    private Factory _factory = null;

    
Constructs a new instance of the updater for the factory provided.

Parameters:
factory
    public AutoUpdater(final Factory factory) {
        super();
         = factory;
    }

    
Runs the Updater.
    @Override
    public void run() {
        final long currentPublishedDate = .getProvider().getPublishedDate().getTime();
        /*
         * Check the last accessed date of the binary file to determine if
         * it should be updated. Update will also proceed if lite data is in use
         */
        if (currentPublishedDate + . < System.currentTimeMillis()
                || !.getProvider().getDataSetName().equals("Premium")) {
            .update();
        }
    }
New to GrepCode? Check out our FAQ X