Skip to content

Commit 65df854

Browse files
committed
🎨 Rename configuration properties to be inline with the separated DownloadCache class
1 parent 150b5e2 commit 65df854

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ There are a couple of static classes that help common usage scenarios:
4141

4242
The library has these configuration options:
4343
1. `SPDXParser.OnlyUseLocalLicenses` - a boolean that controls whether the (potentially out of date) listed license information bundled inside the JAR is used (true), vs the library downloading the latest files from the SPDX website (false). Default is false (always download the latest files from the SPDX website).
44-
2. `org.spdx.storage.listedlicense.enableCache` - a boolean that enables or disables a local cache for downloaded listed license information. Defaults to `false` (the cache is disabled). The cache location is determined as per the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) (i.e. `${XDG_CACHE_HOME}/Spdx-Java-Library` or `${HOME}/.cache/Spdx-Java-Library`).
45-
3. `org.spdx.storage.listedlicense.cacheCheckIntervalSecs` - a long that controls how often each cache entry is rechecked for staleness, in units of seconds. Defaults to 86,400 seconds (24 hours). Set to 0 (zero) to have each cache entry checked every time (note: this will result in a lot more network I/O and negatively impact performance, albeit there is still a substantial performance saving vs not using the cache at all).
44+
2. `org.spdx.downloadCacheEnabled` - a boolean that enables or disables the download cache. Defaults to `false` (the cache is disabled). The cache location is determined as per the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) (i.e. `${XDG_CACHE_HOME}/Spdx-Java-Library` or `${HOME}/.cache/Spdx-Java-Library`).
45+
3. `org.spdx.downloadCacheCheckIntervalSecs` - a long that controls how often each cache entry is rechecked for staleness, in units of seconds. Defaults to 86,400 seconds (24 hours). Set to 0 (zero) to have each cache entry checked every time (note: this will result in a lot more network I/O and negatively impact performance, albeit there is still a substantial performance saving vs not using the cache at all).
4646

4747
Note that these configuration options can only be modified prior to first use of Spdx-Java-Library. Once the library is initialized, subsequent changes will have no effect.
4848

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# if true, use licenses from stored set of licenses rather than from the spdx.org/licenses website
1+
# if true, only use license information from the set of licenses stored within the JAR file at release time, rather than
2+
# downloading the latest versions from the SPDX website
23
SPDXParser.OnlyUseLocalLicenses=false
34

4-
# if true, enable a local download cache for listed license files downloaded from the SPDX website
5-
org.spdx.storage.listedlicense.enableCache=false
5+
# if true, enable the download cache
6+
org.spdx.downloadCacheEnabled=false
67

78
# local download cache re-check interval, in seconds
8-
org.spdx.storage.listedlicense.cacheCheckIntervalSecs=86400
9+
org.spdx.downloadCacheCheckIntervalSecs=86400

src/main/java/org/spdx/utility/DownloadCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public final class DownloadCache {
8989
System.getenv("XDG_CACHE_HOME")) +
9090
File.separator + "Spdx-Java-Library";
9191

92-
private final String CONFIG_PROPERTY_CACHE_ENABLED = "org.spdx.storage.listedlicense.enableCache";
93-
private final String CONFIG_PROPERTY_CACHE_CHECK_INTERVAL_SECS = "org.spdx.storage.listedlicense.cacheCheckIntervalSecs";
92+
private final String CONFIG_PROPERTY_CACHE_ENABLED = "org.spdx.downloadCacheEnabled";
93+
private final String CONFIG_PROPERTY_CACHE_CHECK_INTERVAL_SECS = "org.spdx.downloadCacheCheckIntervalSecs";
9494
private final boolean cacheEnabled;
9595
private final long cacheCheckIntervalSecs;
9696

0 commit comments

Comments
 (0)