MCPcopy Index your code
hub / github.com/arduino/Arduino / checkNewFilename

Method checkNewFilename

arduino-core/src/processing/app/Sketch.java:268–276  ·  view source on GitHub ↗

Check if renaming or adding a file would cause a problem because the file already exists in this sketch. If so, an IOEXception is thrown. @param newFile The filename of the new file, or the new name for an existing file.

(File newFile)

Source from the content-addressed store, hash-verified

266 * existing file.
267 */
268 protected void checkNewFilename(File newFile) throws IOException {
269 // Verify that the sketch doesn't have a filem with the new name
270 // already, other than the current primary (index 0)
271 if (findFileIndex(newFile) >= 0) {
272 String msg = I18n.format(tr("The sketch already contains a file named \"{0}\""), newFile.getName());
273 throw new IOException(msg);
274 }
275
276 }
277
278 /**
279 * Rename this sketch' folder to the given name. Unlike saveAs(), this

Callers 3

checkNewFoldernameMethod · 0.95
addFileMethod · 0.95
renameToMethod · 0.80

Calls 4

findFileIndexMethod · 0.95
formatMethod · 0.95
trMethod · 0.80
getNameMethod · 0.65

Tested by

no test coverage detected