public class FileResolver extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
pathPrefix |
protected boolean |
prefixWithPackageName |
| Constructor and Description |
|---|
FileResolver()
Creates a resolver with package prefixing enabled and no path prefix.
|
FileResolver(boolean prefixWithPackageName,
String pathPrefix)
Creates a resolver.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
constructFullFileName(String fileName,
Class<?> testClass)
Get the full file name depending on the package prefixing and path prefix.
|
protected String |
getDefaultFileName(String extension,
Class<?> testClass)
The default name is constructed as follows: 'classname without packagename'.'
|
String |
getPathPrefix() |
boolean |
isPrefixWithPackageName() |
protected String |
prefixPackageNameFilePath(String fileName,
Class<?> testClass)
Prefix the package name of the test to the name of the file (replacing . with /).
|
URI |
resolveDefaultFileName(String extension,
Class<?> testClass)
Resolves the location for a file with the default name: 'classname'.'
|
URI |
resolveFileName(String fileName,
Class<?> testClass)
Resolves the location for a file with a certain name.
|
protected boolean prefixWithPackageName
protected String pathPrefix
public FileResolver()
public FileResolver(boolean prefixWithPackageName,
String pathPrefix)
prefixWithPackageName - True to enable to prefixing of the file name with the package name of the test classpathPrefix - path prefix to add to the file name, null if there is no prefixpublic URI resolveDefaultFileName(String extension, Class<?> testClass)
extension - The extension of the file, not nulltestClass - The test class, not nullpublic URI resolveFileName(String fileName, Class<?> testClass)
fileName - The name of the file, not nulltestClass - The test class, not nullpublic boolean isPrefixWithPackageName()
public String getPathPrefix()
protected String constructFullFileName(String fileName, Class<?> testClass)
fileName - The file name, not nulltestClass - The test class, not nullprotected String prefixPackageNameFilePath(String fileName, Class<?> testClass)
fileName - The file name, not nulltestClass - The test, not nullprotected String getDefaultFileName(String extension, Class<?> testClass)
extension - The extension of the filetestClass - The test class, not nullCopyright © 2016. All Rights Reserved.