public final class TempDir extends Object implements Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this directory.
|
File |
createFile(String relativePath,
InputStream sourceData)
Create a file within this temporary directory, prepopulating the file from the given input stream.
|
protected void |
finalize() |
File |
getFile(String relativePath)
Get the
File for a relative path. |
File |
getRoot()
Get the
File that represents the root of this temporary directory. |
public File getRoot() throws IOException
File
that represents the root of this temporary directory. The returned file is only valid as
long as the tempdir exists.IOException
- if the directory was closed at the time of this invocationpublic File getFile(String relativePath) throws IOException
File
for a relative path. The returned file is only valid as long as the tempdir exists.relativePath
- the relative pathIOException
- if the directory was closed at the time of this invocationpublic File createFile(String relativePath, InputStream sourceData) throws IOException
relativePath
- the relative path namesourceData
- the source input stream to useIOException
- if the directory was closed at the time of this invocation or an error occurspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an I/O error occursCopyright © 2012 JBoss by Red Hat. All Rights Reserved.