File tree 1 file changed +10
-1
lines changed
arduino-core/src/processing/app
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -351,13 +351,22 @@ public void saveAs(File newFolder) throws IOException {
351
351
file .saveAs (new File (newFolder , file .getFileName ()));
352
352
}
353
353
354
- folder = newFolder ;
355
354
356
355
// Copy the data folder (this may take a while.. add progress bar?)
357
356
if (getDataFolder ().exists ()) {
358
357
File newDataFolder = new File (newFolder , "data" );
358
+ // Check if data folder exits, if not try to create the data folder
359
+ if (!newDataFolder .exists () && !newDataFolder .mkdirs ()) {
360
+ String msg = I18n .format (tr ("Could not create directory \" {0}\" " ), newFolder .getAbsolutePath ());
361
+ throw new IOException (msg );
362
+ }
363
+ // Copy the data files into the new folder
359
364
FileUtils .copy (getDataFolder (), newDataFolder );
360
365
}
366
+
367
+ // Change folder to the new folder
368
+ folder = newFolder ;
369
+
361
370
}
362
371
363
372
/**
You can’t perform that action at this time.
0 commit comments