diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-09-06 21:14:28 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-09-06 21:14:28 +0200 |
commit | 363c4c96083a5e4e80766c87fe15912866dc568f (patch) | |
tree | 6fcbdf95d5f9dead8849a38a7e47b7d2f0b6eb5d /archiva-modules/archiva-base/archiva-configuration | |
parent | bc6065c1411229ba124283efa7fd4fce31f144f4 (diff) | |
download | archiva-363c4c96083a5e4e80766c87fe15912866dc568f.tar.gz archiva-363c4c96083a5e4e80766c87fe15912866dc568f.zip |
Switching to enum for policy options
Diffstat (limited to 'archiva-modules/archiva-base/archiva-configuration')
2 files changed, 8 insertions, 8 deletions
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java index fb940af02..b8b78d3b1 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java @@ -323,19 +323,19 @@ public class DefaultArchivaConfiguration // Upgrade old policy settings. if ("releases".equals(policyId) || "snapshots".equals(policyId)) { if ("ignored".equals(setting)) { - setting = AbstractUpdatePolicy.ALWAYS; + setting = AbstractUpdatePolicy.ALWAYS.getId(); } else if ("disabled".equals(setting)) { - setting = AbstractUpdatePolicy.NEVER; + setting = AbstractUpdatePolicy.NEVER.getId(); } } else if ("cache-failures".equals(policyId)) { if ("ignored".equals(setting)) { - setting = CachedFailuresPolicy.NO; + setting = CachedFailuresPolicy.NO.getId(); } else if ("cached".equals(setting)) { - setting = CachedFailuresPolicy.YES; + setting = CachedFailuresPolicy.YES.getId(); } } else if ("checksum".equals(policyId)) { if ("ignored".equals(setting)) { - setting = ChecksumPolicy.IGNORE; + setting = ChecksumPolicy.IGNORE.getId(); } } @@ -344,7 +344,7 @@ public class DefaultArchivaConfiguration Policy policy = findPolicy(policyId); // Does option exist? if (!policy.getOptions().contains(setting)) { - setting = policy.getDefaultOption(); + setting = policy.getDefaultOption().getId(); } connector.addPolicy(policyId, setting); } else { diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java index 5f9de1910..20e3f34cf 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java @@ -104,8 +104,8 @@ public class MavenProxyPropertyLoader proxyConnector.setTargetRepoId( key ); proxyConnector.setProxyId( proxyKey ); // TODO: convert cachePeriod to closest "daily" or "hourly" - proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY ); - proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS ); + proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY.getId() ); + proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS.getId() ); configuration.addProxyConnector( proxyConnector ); } |