Skip to content

Commit 48ad7ed

Browse files
cmaglieFederico Fissore
authored andcommitted
Added FileUtils.createTempFolderIn(folder) method
1 parent a8b29d4 commit 48ad7ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arduino-core/src/processing/app/helpers/FileUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ public static void recursiveDelete(File file) {
8383
}
8484

8585
public static File createTempFolder() throws IOException {
86-
File tmpFolder = new File(System.getProperty("java.io.tmpdir"), "arduino_" + new Random().nextInt(1000000));
86+
return createTempFolderIn(new File(System.getProperty("java.io.tmpdir")));
87+
}
88+
89+
public static File createTempFolderIn(File parent) throws IOException {
90+
File tmpFolder = new File(parent, "arduino_"
91+
+ new Random().nextInt(1000000));
8792
if (!tmpFolder.mkdir()) {
8893
throw new IOException("Unable to create temp folder " + tmpFolder);
8994
}

0 commit comments

Comments
 (0)