add "throws IOException" to java.io.File.createTempFile

This commit is contained in:
Joel Dice 2012-02-20 17:23:18 -07:00
parent f63d4584c2
commit 3111f07430
2 changed files with 11 additions and 4 deletions

View File

@ -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"));
}

View File

@ -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);