public interface TemporaryFolder extends ExternalResource
This class is exposed by the temporaryFolder()
method of the TestSuite
interface. Created file and folder by this rule (or created inside the once
created by this rule) are removed after test execution.
Modifier and Type | Interface and Description |
---|---|
static interface |
TemporaryFolder.InitialEntry
Generic part regarding initial context of a temporary folder.
|
static interface |
TemporaryFolder.InitialFileEntry
An initial file.
|
static interface |
TemporaryFolder.InitialFolderEntry
An initial folder.
|
static interface |
TemporaryFolder.TemporaryFolderBuilder
This is a builder for temporary folder.
|
Modifier and Type | Method and Description |
---|---|
TemporaryFolder.InitialFolderEntry |
getInitial()
Get the initial temporary folder info
|
Path |
getRootFolder()
Get the rootFolder.
|
Path |
newFile()
Create a new file with generated name.
|
Path |
newFile(String fileName)
Create a new file with specified name.
|
Path |
newFile(String fileName,
byte[] data)
Create a new file with specified name and data.
|
Path |
newFolder()
Create a new folder with generated name.
|
Path |
newFolder(String folderName)
Create a new folder with specified name.
|
after, before, onEnd, onStart
computeStatement, of, onAssumptionSkip, onEnd, onError, onFailure, onStart
Path newFile() throws IOException
IOException
- in case of errorPath newFile(String fileName) throws IOException
fileName
- the file nameIOException
- in case of errorPath newFile(String fileName, byte[] data) throws IOException
fileName
- the file namedata
- the byte that must be wrote into the fileIOException
- in case of errorPath newFolder() throws IOException
IOException
- in case of errorPath newFolder(String folderName) throws IOException
folderName
- the folder nameIOException
- in case of errorPath getRootFolder()
TemporaryFolder.InitialFolderEntry getInitial()
Copyright © 2015 Powerunit. All rights reserved.