MCPcopy Create free account
hub / github.com/PCGen/pcgen / getConfigPath

Method getConfigPath

code/src/java/pcgen/system/Main.java:145–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143 }
144
145 private static String getConfigPath()
146 {
147 String aPath = System.getProperty("pcgen.config"); //$NON-NLS-1$
148 if (aPath != null)
149 {
150 File testPath = new File(aPath);
151 // Then make sure it's an existing folder
152 if (testPath.exists() && testPath.isDirectory())
153 {
154 return aPath;
155 }
156 }
157 // Otherwise return command line argument for the settings directory
158 // Otherwise return user dir
159 return commandLineArguments.getSettingsDir()
160 .map(File::getPath)
161 .orElse(SystemUtils.USER_DIR);
162 }
163
164 /**
165 * Initialize Main - must be called before any other getter can be used.

Callers 1

mainMethod · 0.95

Calls 4

orElseMethod · 0.65
getPropertyMethod · 0.45
existsMethod · 0.45
getSettingsDirMethod · 0.45

Tested by

no test coverage detected