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)
| 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 |
no test coverage detected