public final class TestingFs extends Object
static methods for working with directories in testing
environments.| Modifier and Type | Method and Description |
|---|---|
static Directory |
createTempDirectory()
Creates a randomly named directory that is automatically removed during the
JVM shutdown process.
|
static Directory |
getTestInf()
Returns the parent directory of the resource named
TEST-INF/.marker. |
static br.com.objectos.collections.list.ImmutableList<String> |
list(Directory directory)
Recursively lists the relative pathnames of all entries of the specified
directory; the result is both sorted and immutable.
|
static br.com.objectos.collections.list.ImmutableList<String> |
listFiles(Directory directory)
Recursively lists the relative pathnames of all (regular) files of the
specified directory; the result is both sorted and immutable.
|
public static Directory createTempDirectory() throws IOException
The returned directory will be a direct child of the directory returned by
the JavaIoTmpdir class.
IOException - if an I/O error occurspublic static Directory getTestInf() throws IOException
TEST-INF/.marker.
This is intended to ease working with test resources (as defined by Maven build tool) in modular project.
TEST-INF/.markerIOException - if the marker cannot be found, the marker is not a regular file or
another I/O error occurspublic static br.com.objectos.collections.list.ImmutableList<String> list(Directory directory) throws IOException
directory - the directory to listIOException - if an I/O error occurspublic static br.com.objectos.collections.list.ImmutableList<String> listFiles(Directory directory) throws IOException
directory - the directory to listIOException - if an I/O error occursCopyright © 2011–2021 Objectos Software LTDA. All rights reserved.