public class FileTestUtils
extends java.lang.Object
| Constructor and Description |
|---|
FileTestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertFileContent(java.nio.file.Path dir,
java.lang.String filename,
java.lang.String expected)
Check that a file contains a given String
|
static void |
unzip(java.nio.file.Path zip,
java.nio.file.Path destDir,
java.lang.String prefixToRemove)
Unzip a zip file to a destination directory.
|
public static void assertFileContent(java.nio.file.Path dir,
java.lang.String filename,
java.lang.String expected)
throws java.io.IOException
dir - root dir for filefilename - relative path from root dir to fileexpected - expected content (if null, we don't expect any file)java.io.IOExceptionpublic static void unzip(java.nio.file.Path zip,
java.nio.file.Path destDir,
@Nullable
java.lang.String prefixToRemove)
throws java.io.IOException
zip - zip file to unzipdestDir - directory to unzip the file toprefixToRemove - the (optional) prefix in the zip file path to remove when writing to the destination directoryjava.io.IOException - if zip file does not exist, or there was an error reading from the zip file or
writing to the destination directory