MCPcopy
hub / github.com/arduino/Arduino / getSettingsFolder

Method getSettingsFolder

arduino-core/src/processing/app/BaseNoGui.java:288–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286 }
287
288 static public File getSettingsFolder() {
289 if (getPortableFolder() != null)
290 return getPortableFolder();
291
292 File settingsFolder = null;
293
294 String preferencesPath = PreferencesData.get("settings.path");
295 if (preferencesPath != null) {
296 settingsFolder = absoluteFile(preferencesPath);
297
298 } else {
299 try {
300 settingsFolder = getPlatform().getSettingsFolder();
301 } catch (Exception e) {
302 showError(tr("Problem getting data folder"),
303 tr("Error getting the Arduino data folder."), e);
304 }
305 }
306
307 // create the folder if it doesn't exist already
308 if (!settingsFolder.exists()) {
309 if (!settingsFolder.mkdirs()) {
310 showError(tr("Settings issues"),
311 tr("Arduino cannot run because it could not\n" +
312 "create a folder to store your settings."), null);
313 }
314 }
315 return settingsFolder;
316 }
317
318 static public File getSketchbookFolder() {
319 String sketchBookPath = PreferencesData.get("sketchbook.path");

Callers 6

callArduinoBuilderMethod · 0.95
FileDownloaderCacheClass · 0.95
getSettingsFileMethod · 0.95
initPackagesMethod · 0.95
BaseMethod · 0.95

Calls 7

getPortableFolderMethod · 0.95
getMethod · 0.95
absoluteFileMethod · 0.95
getPlatformMethod · 0.95
showErrorMethod · 0.95
trMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected