public class TemporaryFiles extends Object implements AutoCloseable
Constructor and Description |
---|
TemporaryFiles() |
Modifier and Type | Method and Description |
---|---|
File |
add(File file)
Adds a file to be deleted.
|
void |
close() |
File |
create(String prefix,
String suffix)
Creates a new temporary file.
|
File |
create(String prefix,
String suffix,
InputStream contents)
Creates a new temporary file.
|
public File add(File file)
file
- the target filepublic File create(String prefix, String suffix) throws IOException
prefix
- the file prefixsuffix
- the file suffix (nullable)IOException
- if I/O error was occurred while creating the filepublic File create(String prefix, String suffix, InputStream contents) throws IOException
prefix
- the file prefixsuffix
- the file suffix (nullable)contents
- the file contentsIOException
- if I/O error was occurred while creating the filepublic void close()
close
in interface AutoCloseable
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.