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

Method checkSketchFile

arduino-core/src/processing/app/Sketch.java:57–78  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

55 }
56
57 static public File checkSketchFile(File file) {
58 // check to make sure that this .pde file is
59 // in a folder of the same name
60 String fileName = file.getName();
61 File parent = file.getParentFile();
62 String parentName = parent.getName();
63 String pdeName = parentName + ".pde";
64 File altPdeFile = new File(parent, pdeName);
65 String inoName = parentName + ".ino";
66 File altInoFile = new File(parent, inoName);
67
68 if (pdeName.equals(fileName) || inoName.equals(fileName))
69 return file;
70
71 if (altPdeFile.exists())
72 return altPdeFile;
73
74 if (altInoFile.exists())
75 return altInoFile;
76
77 return null;
78 }
79
80 /**
81 * Reload the list of files. This checks the sketch directory on disk,

Callers 1

handleOpenInternalMethod · 0.95

Calls 3

getNameMethod · 0.65
equalsMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected