public static TemporaryFileRule inUserHome() {
    return new TemporaryFileRule(System.getProperty("user.home"));
  }
A {@link org.junit.rules.TestRule} to create temporary files in a given directory that should be
deleted when the test method finishes. This is useful in place of
{@link org.junit.rules.TemporaryFolder} when a test needs to create files in a particular
directory, for example user.home or user.dir.

<p>
Example of usage:

<pre>
public static class HasTemporaryFile {
  &#064;Rule
  public TemporaryFileRule temporaryFileRule = TemporaryFileRule.inUserHome();

  &#064;Test
  public void testUsingTempFolder() throws IOException {
    File createdFile = temporaryFileRule.newFile(&quot;myfile.txt&quot;);
    File createdFile = temporaryFileRule.newFile(&quot;myfile2.txt&quot;);
    // ...
  }
}
</pre>
geode-junit/src/main/java/org/apache/geode/test/junit/rules/TemporaryFileRule.java