public abstract class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.core.io.Resource |
getFileResource(String filePath,
TestContext context)
Reads file resource from path with variable replacement support.
|
static List<File> |
getTestFiles(String startDir)
Method to retrieve all test defining XML files in given directory.
|
static String |
readToString(InputStream inputStream)
Read file input stream to string value with default charset settings.
|
static String |
readToString(InputStream inputStream,
Charset charset)
Read file input stream to string value.
|
static String |
readToString(org.springframework.core.io.Resource resource)
Read file resource to string value with default charset settings.
|
static String |
readToString(org.springframework.core.io.Resource resource,
Charset charset)
Read file resource to string value.
|
static void |
writeToFile(String content,
File file)
Writes String content to file.
|
static void |
writeToFile(String content,
File file,
Charset charset)
Writes String content to file with given charset encoding.
|
public static String readToString(org.springframework.core.io.Resource resource) throws IOException
resource - IOExceptionpublic static String readToString(InputStream inputStream) throws IOException
inputStream - IOExceptionpublic static String readToString(org.springframework.core.io.Resource resource, Charset charset) throws IOException
resource - charset - IOExceptionpublic static String readToString(InputStream inputStream, Charset charset) throws IOException
inputStream - charset - IOExceptionpublic static void writeToFile(String content, File file)
content - file - public static void writeToFile(String content, File file, Charset charset)
content - file - public static List<File> getTestFiles(String startDir)
startDir - the directory to hold the filespublic static org.springframework.core.io.Resource getFileResource(String filePath, TestContext context)
filePath - context - Copyright © 2008–2015 ConSol* Consulting&Solutions GmbH. All rights reserved.