Skip to content

Commit 134a8ae

Browse files
committed
[refactor] Rename class to ExistSystemProperties to make it clear these are not Java System Properties
1 parent 69d611c commit 134a8ae

File tree

16 files changed

+52
-54
lines changed

16 files changed

+52
-54
lines changed

exist-core/src/main/java/org/exist/SystemProperties.java renamed to exist-core/src/main/java/org/exist/ExistSystemProperties.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@
3535
* @author <a href="mailto:[email protected]">Adam Retter</a>
3636
*/
3737
@ThreadSafe
38-
public class SystemProperties {
38+
public class ExistSystemProperties {
3939

40-
private static final Logger LOG = LogManager.getLogger(SystemProperties.class);
41-
private static final SystemProperties instance = new SystemProperties();
40+
private static final Logger LOG = LogManager.getLogger(ExistSystemProperties.class);
41+
private static final ExistSystemProperties instance = new ExistSystemProperties();
4242

4343
private final AtomicLazyVal<Properties> properties = new AtomicLazyVal<>(this::load);
4444

45-
public final static SystemProperties getInstance() {
45+
public final static ExistSystemProperties getInstance() {
4646
return instance;
4747
}
4848

49-
private SystemProperties() {
49+
private ExistSystemProperties() {
5050
}
5151

5252
private Properties load() {
5353
final Properties properties = new Properties();
54-
try (final InputStream is = SystemProperties.class.getResourceAsStream("system.properties")) {
54+
try (final InputStream is = ExistSystemProperties.class.getResourceAsStream("system.properties")) {
5555
if (is != null) {
5656
properties.load(is);
5757
}
@@ -61,11 +61,11 @@ private Properties load() {
6161
return properties;
6262
}
6363

64-
public String getSystemProperty(final String propertyName) {
64+
public String getExistSystemProperty(final String propertyName) {
6565
return properties.get().getProperty(propertyName);
6666
}
6767

68-
public String getSystemProperty(final String propertyName, final String defaultValue) {
68+
public String getExistSystemProperty(final String propertyName, final String defaultValue) {
6969
return properties.get().getProperty(propertyName, defaultValue);
7070
}
7171
}

exist-core/src/main/java/org/exist/Version.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public final class Version {
3636

3737
static {
3838

39-
final SystemProperties systemProperties = SystemProperties.getInstance();
40-
NAME = systemProperties.getSystemProperty("product-name", "eXist");
41-
VERSION = systemProperties.getSystemProperty("product-version");
42-
BUILD = systemProperties.getSystemProperty("product-build");
43-
GIT_BRANCH = systemProperties.getSystemProperty("git-branch");
44-
GIT_COMMIT = systemProperties.getSystemProperty("git-commit");
39+
final ExistSystemProperties existSystemProperties = ExistSystemProperties.getInstance();
40+
NAME = existSystemProperties.getExistSystemProperty("product-name", "eXist");
41+
VERSION = existSystemProperties.getExistSystemProperty("product-version");
42+
BUILD = existSystemProperties.getExistSystemProperty("product-build");
43+
GIT_BRANCH = existSystemProperties.getExistSystemProperty("git-branch");
44+
GIT_COMMIT = existSystemProperties.getExistSystemProperty("git-commit");
4545
}
4646

4747
public static String getProductName() {

exist-core/src/main/java/org/exist/client/ClientFrame.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
package org.exist.client;
2323

24-
import org.exist.SystemProperties;
24+
import org.exist.ExistSystemProperties;
2525
import org.exist.backup.Backup;
2626
import org.exist.backup.CreateBackupDialog;
2727
import org.exist.backup.GuiRestoreServiceTaskListener;
@@ -1724,7 +1724,7 @@ protected static Properties getLoginData(final Properties props) {
17241724

17251725
final ConnectionDialog connectionDialog = new ConnectionDialog(null, true, defaultConnectionSettings, Boolean.parseBoolean(props.getProperty(InteractiveClient.LOCAL_MODE, InteractiveClient.LOCAL_MODE_DEFAULT)), Boolean.parseBoolean(props.getProperty(InteractiveClient.NO_EMBED_MODE, InteractiveClient.NO_EMBED_MODE_DEFAULT)));
17261726

1727-
connectionDialog.setTitle(SystemProperties.getInstance().getSystemProperty("product-name", "eXist-db") + " " + SystemProperties.getInstance().getSystemProperty("product-version", "unknown") + " Database Login");
1727+
connectionDialog.setTitle(ExistSystemProperties.getInstance().getExistSystemProperty("product-name", "eXist-db") + " " + ExistSystemProperties.getInstance().getExistSystemProperty("product-version", "unknown") + " Database Login");
17281728

17291729
connectionDialog.addDialogCompleteWithResponseCallback(connection -> {
17301730
properties.setProperty(InteractiveClient.USER, connection.getUsername());

exist-core/src/main/java/org/exist/client/InteractiveClient.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@
4444
import javax.xml.transform.OutputKeys;
4545

4646
import org.apache.tools.ant.DirectoryScanner;
47-
import org.exist.SystemProperties;
47+
import org.exist.ExistSystemProperties;
4848
import org.exist.dom.persistent.XMLUtil;
49-
import org.exist.security.ACLPermission;
5049
import org.exist.security.Account;
5150
import org.exist.security.Permission;
5251
import org.exist.security.SecurityManager;
@@ -2517,12 +2516,12 @@ public void printNotice() {
25172516

25182517
public String getNotice() {
25192518
final StringBuilder builder = new StringBuilder();
2520-
builder.append(SystemProperties.getInstance().getSystemProperty("product-name", "eXist-db"));
2519+
builder.append(ExistSystemProperties.getInstance().getExistSystemProperty("product-name", "eXist-db"));
25212520
builder.append(" version ");
2522-
builder.append(SystemProperties.getInstance().getSystemProperty("product-version", "unknown"));
2523-
if (!"".equals(SystemProperties.getInstance().getSystemProperty("git-commit", ""))) {
2521+
builder.append(ExistSystemProperties.getInstance().getExistSystemProperty("product-version", "unknown"));
2522+
if (!"".equals(ExistSystemProperties.getInstance().getExistSystemProperty("git-commit", ""))) {
25242523
builder.append(" (");
2525-
builder.append(SystemProperties.getInstance().getSystemProperty("git-commit", "(unknown Git commit ID)"));
2524+
builder.append(ExistSystemProperties.getInstance().getExistSystemProperty("git-commit", "(unknown Git commit ID)"));
25262525
builder.append(")");
25272526
}
25282527
builder.append(", Copyright (C) 2001-");

exist-core/src/main/java/org/exist/jetty/JettyStart.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.eclipse.jetty.util.MultiException;
3434
import org.eclipse.jetty.util.component.LifeCycle;
3535
import org.eclipse.jetty.xml.XmlConfiguration;
36-
import org.exist.SystemProperties;
36+
import org.exist.ExistSystemProperties;
3737
import org.exist.http.servlets.ExistExtensionServlet;
3838
import org.exist.start.CompatibleJavaVersionCheck;
3939
import org.exist.start.Main;
@@ -190,9 +190,9 @@ public synchronized void run(final String[] args, final Observer observer) {
190190

191191
logger.info("Running as user '{}'", System.getProperty("user.name", "(unknown user.name)"));
192192
logger.info("[eXist Home : {}]", System.getProperty("exist.home", "unknown"));
193-
logger.info("[eXist Version : {}]", SystemProperties.getInstance().getSystemProperty("product-version", "unknown"));
194-
logger.info("[eXist Build : {}]", SystemProperties.getInstance().getSystemProperty("product-build", "unknown"));
195-
logger.info("[Git commit : {}]", SystemProperties.getInstance().getSystemProperty("git-commit", "unknown"));
193+
logger.info("[eXist Version : {}]", ExistSystemProperties.getInstance().getExistSystemProperty("product-version", "unknown"));
194+
logger.info("[eXist Build : {}]", ExistSystemProperties.getInstance().getExistSystemProperty("product-build", "unknown"));
195+
logger.info("[Git commit : {}]", ExistSystemProperties.getInstance().getExistSystemProperty("git-commit", "unknown"));
196196

197197
logger.info("[Operating System : {} {} {}]", System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"));
198198
logger.info("[log4j.configurationFile : {}]", System.getProperty("log4j.configurationFile"));

exist-core/src/main/java/org/exist/launcher/SplashScreen.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
package org.exist.launcher;
2323

24+
import org.exist.ExistSystemProperties;
2425
import org.exist.jetty.JettyStart;
2526
import org.exist.storage.BrokerPool;
2627

@@ -31,8 +32,6 @@
3132
import java.util.Observable;
3233
import java.util.Observer;
3334

34-
import org.exist.SystemProperties;
35-
3635
/**
3736
* Display a splash screen showing the eXist-db logo and a status line.
3837
*
@@ -67,11 +66,11 @@ public SplashScreen(Launcher launcher) {
6766
getContentPane().add(imageLabel, BorderLayout.NORTH);
6867

6968
// version label
70-
final SystemProperties sysProps = SystemProperties.getInstance();
69+
final ExistSystemProperties sysProps = ExistSystemProperties.getInstance();
7170
final StringBuilder builder = new StringBuilder();
7271
builder.append("Version ");
73-
builder.append(sysProps.getSystemProperty("product-version", "unknown"));
74-
final String gitCommit = sysProps.getSystemProperty("git-commit");
72+
builder.append(sysProps.getExistSystemProperty("product-version", "unknown"));
73+
final String gitCommit = sysProps.getExistSystemProperty("git-commit");
7574
if (gitCommit != null && !gitCommit.isEmpty()) {
7675
builder.append(" (");
7776
builder.append(gitCommit, 0, Math.min(7, gitCommit.length()));

exist-core/src/main/java/org/exist/management/impl/SystemInfo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.nio.charset.Charset;
2525
import java.util.Locale;
2626

27-
import org.exist.SystemProperties;
27+
import org.exist.ExistSystemProperties;
2828

2929
/**
3030
* Class SystemInfo
@@ -38,22 +38,22 @@ public class SystemInfo implements SystemInfoMXBean {
3838

3939
@Override
4040
public String getProductName() {
41-
return SystemProperties.getInstance().getSystemProperty("product-name","eXist");
41+
return ExistSystemProperties.getInstance().getExistSystemProperty("product-name","eXist");
4242
}
4343

4444
@Override
4545
public String getProductVersion() {
46-
return SystemProperties.getInstance().getSystemProperty("product-version","unknown");
46+
return ExistSystemProperties.getInstance().getExistSystemProperty("product-version","unknown");
4747
}
4848

4949
@Override
5050
public String getProductBuild() {
51-
return SystemProperties.getInstance().getSystemProperty("product-build","unknown");
51+
return ExistSystemProperties.getInstance().getExistSystemProperty("product-build","unknown");
5252
}
5353

5454
@Override
5555
public String getGitCommit() {
56-
return SystemProperties.getInstance().getSystemProperty("git-commit", "unknown Git commit ID");
56+
return ExistSystemProperties.getInstance().getExistSystemProperty("git-commit", "unknown Git commit ID");
5757
}
5858

5959
@Override

exist-core/src/main/java/org/exist/repo/ClasspathHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import org.apache.logging.log4j.LogManager;
2525
import org.apache.logging.log4j.Logger;
26-
import org.exist.SystemProperties;
26+
import org.exist.ExistSystemProperties;
2727
import org.exist.start.Classpath;
2828
import org.exist.start.EXistClassLoader;
2929
import org.exist.storage.BrokerPool;
@@ -108,7 +108,7 @@ private static void scanPackages(BrokerPool pool, Classpath classpath) {
108108
private static boolean isCompatible(final Package pkg) throws PackageException {
109109
// determine the eXist-db version this package is compatible with
110110
final Collection<ProcessorDependency> processorDeps = pkg.getProcessorDeps();
111-
final String procVersion = SystemProperties.getInstance().getSystemProperty("product-version", "1.0");
111+
final String procVersion = ExistSystemProperties.getInstance().getExistSystemProperty("product-version", "1.0");
112112
PackageLoader.Version requiresExistVersion = null;
113113
for (final ProcessorDependency dependency: processorDeps) {
114114
if (Deployment.PROCESSOR_NAME.equals(dependency.getProcessor())) {

exist-core/src/main/java/org/exist/repo/Deployment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.logging.log4j.LogManager;
2626
import org.apache.logging.log4j.Logger;
2727
import org.exist.EXistException;
28-
import org.exist.SystemProperties;
28+
import org.exist.ExistSystemProperties;
2929
import org.exist.collections.Collection;
3030
import org.exist.collections.triggers.TriggerException;
3131
import org.exist.dom.QName;
@@ -286,7 +286,7 @@ public Optional<String> installAndDeploy(final DBBroker broker, final Txn transa
286286
}
287287

288288
private void checkProcessorVersion(final PackageLoader.Version version) throws PackageException {
289-
final String procVersion = SystemProperties.getInstance().getSystemProperty("product-version", "1.0");
289+
final String procVersion = ExistSystemProperties.getInstance().getExistSystemProperty("product-version", "1.0");
290290

291291
final DependencyVersion depVersion = version.getDependencyVersion();
292292
if (!depVersion.isCompatible(procVersion)) {

exist-core/src/main/java/org/exist/webstart/JnlpWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.apache.commons.io.FilenameUtils;
3636
import org.apache.logging.log4j.LogManager;
3737
import org.apache.logging.log4j.Logger;
38-
import org.exist.SystemProperties;
38+
import org.exist.ExistSystemProperties;
3939
import org.exist.util.FileUtils;
4040
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
4141

@@ -101,7 +101,7 @@ void writeJnlpXML(JnlpJarFiles jnlpFiles, HttpServletRequest request,
101101
writer.writeAttribute("codebase", codeBase);
102102
writer.writeAttribute("href", "exist.jnlp");
103103

104-
String version = SystemProperties.getInstance().getSystemProperty("product-version", null);
104+
String version = ExistSystemProperties.getInstance().getExistSystemProperty("product-version", null);
105105
if(version!=null){
106106
writer.writeAttribute("version", version);
107107
}

0 commit comments

Comments
 (0)