Package org.cactoos.io
Class TempFolder
- java.lang.Object
-
- org.cactoos.io.TempFolder
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Scalar<Path>
public final class TempFolder extends Object implements Scalar<Path>, Closeable
A temporary folder. This is ephemeral folder to be used in small scopes. The physical folder is deleted from the filesystem when the temp folder is closed.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description TempFolder()
Ctor.TempFolder(String path)
Ctor.TempFolder(Text path)
Ctor.
-
-
-
Constructor Detail
-
TempFolder
public TempFolder()
Ctor. Creates new folder in temporary directory with a random name.- Since:
- 1.0
-
TempFolder
public TempFolder(String path)
Ctor. Creates new folder in temporary directory.- Parameters:
path
- Relative path to new directory.- Since:
- 1.0
-
TempFolder
public TempFolder(Text path)
Ctor. Creates new folder in temporary directory.- Parameters:
path
- Relative path to new directory.- Since:
- 1.0
-
-
Method Detail
-
value
public Path value() throws Exception
Description copied from interface:Scalar
Convert it to the value.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-