From 6c9a1e1643638de61da539aa77ed851c47b447c6 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 20 Feb 2012 17:23:18 -0700 Subject: [PATCH] add "throws IOException" to java.io.File.createTempFile --- classpath/java/io/File.java | 9 +++++++-- test/Files.java | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/classpath/java/io/File.java b/classpath/java/io/File.java index bfae0da9b6..a77502c041 100644 --- a/classpath/java/io/File.java +++ b/classpath/java/io/File.java @@ -35,11 +35,16 @@ public class File implements Serializable { this(parent.getPath() + FileSeparator + child); } - public static File createTempFile(String prefix, String suffix) { + public static File createTempFile(String prefix, String suffix) + throws IOException + { return createTempFile(prefix, suffix, null); } - public static File createTempFile(String prefix, String suffix, File directory) { + public static File createTempFile(String prefix, String suffix, + File directory) + throws IOException + { if(directory == null) { directory = new File(System.getProperty("java.io.tmpdir")); } diff --git a/test/Files.java b/test/Files.java index 7661e79018..f3d1988f31 100644 --- a/test/Files.java +++ b/test/Files.java @@ -21,7 +21,9 @@ public class Files { } - private static void setExecutableTestWithPermissions(boolean executable) { + private static void setExecutableTestWithPermissions(boolean executable) + throws Exception + { File file = File.createTempFile("avian.", null); file.setExecutable(executable); if (executable) { @@ -33,7 +35,7 @@ public class Files { } } - public static void main(String[] args) { + public static void main(String[] args) throws Exception { isAbsoluteTest(true); isAbsoluteTest(false); setExecutableTestWithPermissions(true);