Class LocalDataSource
java.lang.Object
org.owasp.dependencycheck.data.update.LocalDataSource
- All Implemented Interfaces:
CachedWebDataSource
- Direct Known Subclasses:
HostedSuppressionsDataSource, RetireJSDataSource
- Author:
- Jeremy Long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InstantgetLastUpdated(@NonNull File repo) Retrieves the last updated date from the local file system (in a file next to the repo file).protected booleanDetermines if we should update the local data source.protected voidsaveLastUpdated(@NonNull File repo) Saves the timestamp in a properties file adjacent to the provided repo fileMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CachedWebDataSource
purge, update
-
Constructor Details
-
LocalDataSource
public LocalDataSource()
-
-
Method Details
-
saveLastUpdated
Saves the timestamp in a properties file adjacent to the provided repo file- Parameters:
repo- the local file data source
-
getLastUpdated
-
isStale
Determines if we should update the local data source.- Parameters:
repo- the local file data sourcevalidFor- the duration for which the local data source should be considered valid- Returns:
trueif an update to the data source should be performed; otherwisefalse. If the repo does not exist, or is an empty file, it is considered stale.
-