net.thucydides.core.util
Class ExtendedTemporaryFolder

Package class diagram package ExtendedTemporaryFolder
java.lang.Object
  extended by org.junit.rules.ExternalResource
      extended by net.thucydides.core.util.ExtendedTemporaryFolder
All Implemented Interfaces:
org.junit.rules.TestRule

public class ExtendedTemporaryFolder
extends org.junit.rules.ExternalResource


Constructor Summary
ExtendedTemporaryFolder()
           
ExtendedTemporaryFolder(File parentFolder)
           
 
Method Summary
protected  void after()
           
protected  void before()
           
 void create()
          for testing purposes only.
 void delete()
          Delete all files and folders under the temporary folder.
 File getRoot()
           
protected static boolean isWindows()
           
 File newFile()
          Returns a new fresh file with a random name under the temporary folder.
 File newFile(String fileName)
           
 File newFolder()
           
 File newFolder(String... folderNames)
          Returns a new fresh folder with the given name(s) under the temporary folder.
 File newFolder(String folder)
          Returns a new fresh folder with the given name under the temporary folder.
 
Methods inherited from class org.junit.rules.ExternalResource
apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedTemporaryFolder

public ExtendedTemporaryFolder()

ExtendedTemporaryFolder

public ExtendedTemporaryFolder(File parentFolder)
Method Detail

before

protected void before()
               throws Throwable
Overrides:
before in class org.junit.rules.ExternalResource
Throws:
Throwable

after

protected void after()
Overrides:
after in class org.junit.rules.ExternalResource

create

public void create()
            throws IOException
for testing purposes only. Do not use.

Throws:
IOException

newFile

public File newFile()
             throws IOException
Returns a new fresh file with a random name under the temporary folder.

Throws:
IOException

newFolder

public File newFolder(String folder)
               throws IOException
Returns a new fresh folder with the given name under the temporary folder.

Throws:
IOException

newFolder

public File newFolder(String... folderNames)
               throws IOException
Returns a new fresh folder with the given name(s) under the temporary folder.

Throws:
IOException

getRoot

public File getRoot()
Returns:
the location of this temporary folder.

delete

public void delete()
Delete all files and folders under the temporary folder. Usually not called directly, since it is automatically applied by the Rule


isWindows

protected static boolean isWindows()

newFolder

public File newFolder()
               throws IOException
Throws:
IOException

newFile

public File newFile(String fileName)
             throws IOException
Throws:
IOException


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.