public class BaseHome extends Object
${jetty.home}, ${jetty.base}, directories.
By default, both ${jetty.home} and ${jetty.base} are the same directory, but they can point at different directories.
The ${jetty.home} directory is where the main Jetty binaries and default configuration is housed.
The ${jetty.base} directory is where the execution specific configuration and webapps are obtained from.
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseHome.SearchDir |
| Modifier and Type | Field and Description |
|---|---|
static String |
JETTY_BASE |
static String |
JETTY_HOME |
| Constructor and Description |
|---|
BaseHome() |
BaseHome(CommandLineConfigSource cmdLineSource) |
BaseHome(ConfigSources sources) |
BaseHome(String[] cmdLine) |
| Modifier and Type | Method and Description |
|---|---|
String |
getBase() |
Path |
getBasePath() |
Path |
getBasePath(String path)
Create a
Path reference to some content in "${jetty.base}" |
ConfigSources |
getConfigSources() |
String |
getHome() |
Path |
getHomePath() |
Path |
getPath(String path)
Get a specific path reference.
|
List<Path> |
getPaths(Path dir,
int searchDepth,
String pattern)
Search specified Path with pattern and return hits
|
List<Path> |
getPaths(String pattern)
Get a List of
Paths from a provided pattern. |
boolean |
isBaseDifferent() |
String |
toShortForm(File path)
Convenience method for
toShortForm(file.toPath()) |
String |
toShortForm(Path path)
Replace/Shorten arbitrary path with property strings
"${jetty.home}" or "${jetty.base}" where appropriate. |
String |
toShortForm(String path)
Replace/Shorten arbitrary path with property strings
"${jetty.home}" or "${jetty.base}" where appropriate. |
public static final String JETTY_BASE
public static final String JETTY_HOME
public BaseHome()
throws IOException
IOExceptionpublic BaseHome(String[] cmdLine) throws IOException
IOExceptionpublic BaseHome(CommandLineConfigSource cmdLineSource) throws IOException
IOExceptionpublic BaseHome(ConfigSources sources)
public String getBase()
public Path getBasePath()
public Path getBasePath(String path)
Path reference to some content in "${jetty.base}"path - the path to referencepublic ConfigSources getConfigSources()
public String getHome()
public Path getHomePath()
public Path getPath(String path)
Path references are searched based on the config source search order.
${jetty.base}, return that referenceinclude-jetty-dir locations, return that reference${jetty.home}, return that referencePath reference obtained from FileSystem.getPath(String, String...) (no exists check performed)path - the path to get.public List<Path> getPaths(Path dir, int searchDepth, String pattern) throws IOException
dir - the path to a directory to start search fromsearchDepth - the number of directories deep to perform the searchpattern - the raw pattern to use for the search (must be relative)IOException - if unable to search the pathpublic List<Path> getPaths(String pattern) throws IOException
Paths from a provided pattern.
Resolution Steps:
PathMatcher is built using
FileSystem.getPathMatcher(String) as a file search.FileSystem.getRootDirectories()) then this is assumed to
be a absolute file system pattern.Pattern examples:
lib/logging/*.jar${jetty.home} then ${jetty.base} for lib/logging/*.jar contentlib/**/*-dev.jar${jetty.home} then ${jetty.base} for files under lib ending in
-dev.jaretc/jetty.xml${jetty.home}/etc/jetty.xml then ${jetty.base}/etc/jetty.xmlglob:/opt/app/common/*-corp.jar/opt/app/common/ for *-corp.jarNotes:
FileSystem.getPathMatcher(String) for more detailspattern - the pattern to search.IOException - if error during search operationpublic boolean isBaseDifferent()
public String toShortForm(Path path)
"${jetty.home}" or "${jetty.base}" where appropriate.path - the path to shortenCopyright © 1995-2015 Webtide. All Rights Reserved.