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

Method addFile

arduino-core/src/processing/app/Sketch.java:311–322  ·  view source on GitHub ↗
(String newName)

Source from the content-addressed store, hash-verified

309
310
311 public SketchFile addFile(String newName) throws IOException {
312 // Check the name will not cause any conflicts
313 File newFile = new File(folder, newName);
314 checkNewFilename(newFile);
315
316 // Add a new sketchFile
317 SketchFile sketchFile = new SketchFile(this, newFile);
318 files.add(sketchFile);
319 Collections.sort(files, CODE_DOCS_COMPARATOR);
320
321 return sketchFile;
322 }
323
324 /**
325 * Save this sketch under the new name given. Unlike renameTo(), this

Callers

nothing calls this directly

Calls 3

checkNewFilenameMethod · 0.95
sortMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected