|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.core.util.FileResolver
public class FileResolver
Resolves the location for a file with a certain name.
By default, the file name is prefixed with the package name (. replaced by /).
| Field Summary | |
|---|---|
protected String |
pathPrefix
|
protected boolean |
prefixWithPackageName
|
| Constructor Summary | |
|---|---|
FileResolver()
Creates a resolver with package prefixing enabled and no path prefix. |
|
FileResolver(boolean prefixWithPackageName,
String pathPrefix)
Creates a resolver. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean prefixWithPackageName
protected String pathPrefix
| Constructor Detail |
|---|
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 prefix| Method Detail |
|---|
public URI resolveDefaultFileName(String extension,
Class<?> testClass)
extension - The extension of the file, not nulltestClass - The test class, not null
public URI resolveFileName(String fileName,
Class<?> testClass)
fileName - The name of the file, not nulltestClass - The test class, not null
public boolean isPrefixWithPackageName()
public String getPathPrefix()
protected String constructFullFileName(String fileName,
Class<?> testClass)
fileName - The file name, not nulltestClass - The test class, not null
protected String prefixPackageNameFilePath(String fileName,
Class<?> testClass)
fileName - The file name, not nulltestClass - The test, not null
protected String getDefaultFileName(String extension,
Class<?> testClass)
extension - The extension of the filetestClass - The test class, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||