public class TestFileManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TEMP_DIR_PATH
Temp dir from "java.io.tmpdir" property
|
Constructor and Description |
---|
TestFileManager(String baseFilename,
String fileSuffix)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assertFileContents(File dir,
String filename,
String contentsTest) |
void |
assertFileExistence(File dir,
String filename,
boolean shouldExist) |
void |
cleanUp() |
File |
createFile(File dir,
String filename,
String contents) |
File |
createFile(String filename,
String content) |
File |
createTempDir() |
File |
createTempFile() |
protected void |
finalize() |
String |
getFileContents(File file) |
void |
markForDeletion(File toDelete) |
protected void |
maybeWarnAboutCleanUp() |
public static final String TEMP_DIR_PATH
protected void maybeWarnAboutCleanUp()
public void markForDeletion(File toDelete)
toDelete
- public File createTempDir()
public File createTempFile() throws IOException
IOException
- if anypublic void cleanUp() throws IOException
IOException
- if anypublic void assertFileExistence(File dir, String filename, boolean shouldExist)
dir
- filename
- shouldExist
- public void assertFileContents(File dir, String filename, String contentsTest) throws IOException
dir
- filename
- contentsTest
- IOException
- if anypublic File createFile(File dir, String filename, String contents) throws IOException
dir
- filename
- contents
- IOException
- if anypublic String getFileContents(File file) throws IOException
file
- IOException
- if anyprotected void finalize() throws Throwable
public File createFile(String filename, String content) throws IOException
filename
- content
- IOException
- if anyCopyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.