org.apache.maven.shared.tools.easymock
Class TestFileManager
java.lang.Object
org.apache.maven.shared.tools.easymock.TestFileManager
public class TestFileManager
- extends Object
- Version:
- $Id: TestFileManager.java 677117 2008-07-16 00:29:56Z vsiveton $
TEMP_DIR_PATH
public static final String TEMP_DIR_PATH
- Temp dir from "java.io.tmpdir" property
TestFileManager
public TestFileManager(String baseFilename,
String fileSuffix)
- Default constructor
- Parameters:
baseFilename
- fileSuffix
-
maybeWarnAboutCleanUp
protected void maybeWarnAboutCleanUp()
markForDeletion
public void markForDeletion(File toDelete)
- Parameters:
toDelete
-
createTempDir
public File createTempDir()
- Returns:
- a temp dir
createTempFile
public File createTempFile()
throws IOException
- Returns:
- a temp file
- Throws:
IOException
- if any
cleanUp
public void cleanUp()
throws IOException
- Throws:
IOException
- if any
assertFileExistence
public void assertFileExistence(File dir,
String filename,
boolean shouldExist)
- Parameters:
dir
- filename
- shouldExist
-
assertFileContents
public void assertFileContents(File dir,
String filename,
String contentsTest)
throws IOException
- Parameters:
dir
- filename
- contentsTest
-
- Throws:
IOException
- if any
createFile
public File createFile(File dir,
String filename,
String contents)
throws IOException
- Parameters:
dir
- filename
- contents
-
- Returns:
-
- Throws:
IOException
- if any
getFileContents
public String getFileContents(File file)
throws IOException
- Parameters:
file
-
- Returns:
-
- Throws:
IOException
- if any
finalize
protected void finalize()
throws Throwable
-
- Overrides:
finalize
in class Object
- Throws:
Throwable
createFile
public File createFile(String filename,
String content)
throws IOException
- Parameters:
filename
- content
-
- Returns:
-
- Throws:
IOException
- if any
Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.