mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Added FileUtils.createTempFolderIn(folder) method
This commit is contained in:
parent
a8b29d48a5
commit
48ad7ed769
@ -83,7 +83,12 @@ public class FileUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static File createTempFolder() throws IOException {
|
public static File createTempFolder() throws IOException {
|
||||||
File tmpFolder = new File(System.getProperty("java.io.tmpdir"), "arduino_" + new Random().nextInt(1000000));
|
return createTempFolderIn(new File(System.getProperty("java.io.tmpdir")));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File createTempFolderIn(File parent) throws IOException {
|
||||||
|
File tmpFolder = new File(parent, "arduino_"
|
||||||
|
+ new Random().nextInt(1000000));
|
||||||
if (!tmpFolder.mkdir()) {
|
if (!tmpFolder.mkdir()) {
|
||||||
throw new IOException("Unable to create temp folder " + tmpFolder);
|
throw new IOException("Unable to create temp folder " + tmpFolder);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user