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

Method delete

arduino-core/src/processing/app/SketchFile.java:133–150  ·  view source on GitHub ↗
(Path tempBuildFolder)

Source from the content-addressed store, hash-verified

131
132
133 protected boolean delete(Path tempBuildFolder) throws IOException {
134 if (!file.delete()) {
135 return false;
136 }
137
138 List<Path> tempBuildFolders = Stream.of(tempBuildFolder, tempBuildFolder.resolve("sketch"))
139 .filter(path -> Files.exists(path)).collect(Collectors.toList());
140
141 for (Path folder : tempBuildFolders) {
142 if (!deleteCompiledFilesFrom(folder)) {
143 return false;
144 }
145 }
146
147 sketch.removeFile(this);
148
149 return true;
150 }
151
152 private boolean deleteCompiledFilesFrom(Path tempBuildFolder) throws IOException {
153 List<Path> compiledFiles = Files.list(tempBuildFolder)

Callers 11

handleDeleteCodeMethod · 0.95
extractMethod · 0.45
downloadMethod · 0.45
removeMethod · 0.45
initPackagesMethod · 0.45
saveFileMethod · 0.45
removeTmpFileMethod · 0.45
handleOpenInternalMethod · 0.45
addFileMethod · 0.45
messageMethod · 0.45

Calls 4

resolveMethod · 0.80
removeFileMethod · 0.80
existsMethod · 0.45

Tested by 1

removeTmpFileMethod · 0.36