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

Method ensureCustomDirExists

code/src/java/pcgen/core/CustomData.java:241–256  ·  view source on GitHub ↗

This method will check for the system specific custom directory and will create it if it exists.

()

Source from the content-addressed store, hash-verified

239 * and will create it if it exists.
240 */
241 private static void ensureCustomDirExists()
242 {
243 File customDir = new File(PCGenSettings.getCustomDir() + File.separator + SettingsHandler.getGameAsProperty().get().getName());
244 if (!customDir.exists())
245 {
246 try
247 {
248 customDir.mkdirs();
249 } catch (SecurityException se)
250 {
251 Logging.errorPrint(
252 "Unable to create custom data directory '" + customDir.getPath() + "' due the following error.",
253 se);
254 }
255 }
256 }
257
258 /**
259 * Write custom items out

Callers 3

writeCustomFilesMethod · 0.95
writeCustomItemsMethod · 0.95

Calls 7

getCustomDirMethod · 0.95
getGameAsPropertyMethod · 0.95
errorPrintMethod · 0.95
getPathMethod · 0.80
getNameMethod · 0.65
getMethod · 0.65
existsMethod · 0.45

Tested by

no test coverage detected