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

Method getSketchbookPath

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

Source from the content-addressed store, hash-verified

345 }
346
347 static public String getSketchbookPath() {
348 // Get the sketchbook path, and make sure it's set properly
349 String sketchbookPath = PreferencesData.get("sketchbook.path");
350
351 // If a value is at least set, first check to see if the folder exists.
352 // If it doesn't, warn the user that the sketchbook folder is being reset.
353 if (sketchbookPath != null) {
354 File sketchbookFolder;
355 if (getPortableFolder() != null && !new File(sketchbookPath).isAbsolute()) {
356 sketchbookFolder = new File(getPortableFolder(), sketchbookPath);
357 } else {
358 sketchbookFolder = absoluteFile(sketchbookPath);
359 }
360 if (!sketchbookFolder.exists()) {
361 showWarning(tr("Sketchbook folder disappeared"),
362 tr("The sketchbook folder no longer exists.\n" +
363 "Arduino will switch to the default sketchbook\n" +
364 "location, and create a new sketchbook folder if\n" +
365 "necessary. Arduino will then stop talking about\n" +
366 "himself in the third person."), null);
367 sketchbookPath = null;
368 }
369 }
370
371 return sketchbookPath;
372 }
373
374 public static TargetBoard getTargetBoard() {
375 TargetPlatform targetPlatform = getTargetPlatform();

Callers 1

BaseMethod · 0.95

Calls 6

getMethod · 0.95
getPortableFolderMethod · 0.95
absoluteFileMethod · 0.95
showWarningMethod · 0.95
trMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected