@ThreadSafe public class EngineVersionCheck extends Object implements CachedWebDataSource
| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT_ENGINE_RELEASE
The property key indicating when the last version check occurred.
|
static String |
ENGINE_VERSION_CHECKED_ON
The property key indicating when the last version check occurred.
|
| Modifier | Constructor and Description |
|---|---|
|
EngineVersionCheck()
Constructs a new engine version check utility.
|
protected |
EngineVersionCheck(Settings settings)
Constructs a new engine version check utility for testing.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getCurrentReleaseVersion()
Retrieves the current released version number from the github
documentation site.
|
protected String |
getUpdateToVersion()
Getter for updateToVersion - only used for testing.
|
boolean |
purge(Engine engine)
Deletes any locally cached data.
|
protected void |
setUpdateToVersion(String version)
Setter for updateToVersion - only used for testing.
|
protected boolean |
shouldUpdate(long lastChecked,
long now,
DatabaseProperties properties,
String currentVersion)
Determines if a new version of the dependency-check engine has been
released.
|
boolean |
update(Engine engine)
Downloads the current released version number and compares it to the
running engine's version number.
|
public static final String ENGINE_VERSION_CHECKED_ON
public static final String CURRENT_ENGINE_RELEASE
protected EngineVersionCheck(Settings settings)
settings - the configured settingspublic EngineVersionCheck()
protected String getUpdateToVersion()
protected void setUpdateToVersion(String version)
version - the version to testpublic boolean update(Engine engine) throws UpdateException
update in interface CachedWebDataSourceengine - a reference to the dependency-check engineUpdateException - thrown if the local database properties could not
be updatedprotected boolean shouldUpdate(long lastChecked,
long now,
DatabaseProperties properties,
String currentVersion)
throws UpdateException
lastChecked - the epoch time of the last version checknow - the current epoch timeproperties - the database properties objectcurrentVersion - the current version of dependency-checktrue if a newer version of the database has been
released; otherwise falseUpdateException - thrown if there is an error connecting to the
github documentation site or accessing the local database.protected String getCurrentReleaseVersion()
public boolean purge(Engine engine)
CachedWebDataSourcepurge in interface CachedWebDataSourceengine - a reference to the dependency-check enginetrue if the purge was successful; otherwise
falseCopyright © 2012–2020 OWASP. All rights reserved.