org.apache.maven.shared.tools.easymock
Class TestFileManager

java.lang.Object
  extended by org.apache.maven.shared.tools.easymock.TestFileManager

public class TestFileManager
extends Object

Version:
$Id: TestFileManager.java 677117 2008-07-16 00:29:56Z vsiveton $

Field Summary
static String TEMP_DIR_PATH
          Temp dir from "java.io.tmpdir" property
 
Constructor Summary
TestFileManager(String baseFilename, String fileSuffix)
          Default constructor
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMP_DIR_PATH

public static final String TEMP_DIR_PATH
Temp dir from "java.io.tmpdir" property

Constructor Detail

TestFileManager

public TestFileManager(String baseFilename,
                       String fileSuffix)
Default constructor

Parameters:
baseFilename -
fileSuffix -
Method Detail

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.