Static Public Member Functions | |
| static File | getFilePath (String file, String searchRoot) |
| Search for a resource (file) in a context {searchRoot}. | |
| static File | getFilePath (String file) |
| Search (the project directory) for a resource. | |
Static Public Attributes | |
| static int | DEPTH_TO_SEARCH = 30 |
| MAX depth to iterate when searching for files below specified root. | |
Member Function Documentation
◆ getFilePath() [1/2]
|
static |
Search (the project directory) for a resource.
If it doesn't exist throw an exception.
If the system property project.root has been set, probably in the maven surefire plugin config, then this is set as the scope of the search, otherwise the scope is system property user.dir (the directory Java was launched from).
- Parameters
-
file the qualified name of the resource to find
- Returns
- a File representing the resource
- See also
- getFilePath(String, String)
◆ getFilePath() [2/2]
|
static |
Search for a resource (file) in a context {searchRoot}.
The file sought must end in the supplied string, where the components of the string must wholly match the components of the location it is found in - per Path#endsWith
When using this feature be aware that the first match is returned, not the closest in scope, so try to use unique paths.
- Parameters
-
file the qualified name of the resource to find searchRoot which part of the directory structure to search
- Returns
- a File representing the resource
- Exceptions
-
IllegalArgumentException if the resource can't be found
