public abstract class BaseDir
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_BASE_DIR_MARKER_FILE_PATH
The default name for the base dir sentinel properties file.
|
| Modifier and Type | Method and Description |
|---|---|
static java.nio.file.Path |
find()
Finds the “directory” on the classpath that contains a file called
.ratpack. |
static java.nio.file.Path |
find(java.lang.String markerFilePath)
Finds the “directory” on the classpath that contains the marker file at the given path.
|
public static final java.lang.String DEFAULT_BASE_DIR_MARKER_FILE_PATH
Value: ".ratpack"
find(),
Constant Field Valuespublic static java.nio.file.Path find()
.ratpack.
Calling this method is equivalent to calling findBaseDir(".ratpack").
find(String)public static java.nio.file.Path find(java.lang.String markerFilePath)
The classpath search is performed using ClassLoader.getResource(String) using the current thread's context class loader.
If the resource is not found, an IllegalStateException will be thrown.
If the resource is found, the enclosing directory of the resource will be converted to a Path and returned.
This allows a directory within side a JAR (that is on the classpath) to be used as the base dir potentially.
markerFilePath - the path to the marker file on the classpath