public class BaseHome
extends java.lang.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 java.lang.String |
JETTY_BASE |
static java.lang.String |
JETTY_HOME |
| Constructor and Description |
|---|
BaseHome() |
BaseHome(CommandLineConfigSource cmdLineSource) |
BaseHome(ConfigSources sources) |
BaseHome(java.lang.String[] cmdLine) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBase() |
java.nio.file.Path |
getBasePath() |
java.nio.file.Path |
getBasePath(java.lang.String path)
Create a
Path reference to some content in "${jetty.base}" |
ConfigSources |
getConfigSources() |
java.lang.String |
getHome() |
java.nio.file.Path |
getHomePath() |
java.nio.file.Path |
getPath(java.lang.String path)
Get a specific path reference.
|
java.util.List<java.nio.file.Path> |
getPaths(java.nio.file.Path dir,
int searchDepth,
java.lang.String pattern)
Search specified Path with pattern and return hits
|
java.util.List<java.nio.file.Path> |
getPaths(java.lang.String pattern)
Get a List of
Paths from a provided pattern. |
boolean |
isBaseDifferent() |
java.lang.String |
toShortForm(java.io.File path)
Convenience method for
toShortForm(file.toPath()) |
java.lang.String |
toShortForm(java.nio.file.Path path)
Replace/Shorten arbitrary path with property strings
"${jetty.home}" or "${jetty.base}" where appropriate. |
java.lang.String |
toShortForm(java.lang.String path)
Replace/Shorten arbitrary path with property strings
"${jetty.home}" or "${jetty.base}" where appropriate. |
public static final java.lang.String JETTY_BASE
public static final java.lang.String JETTY_HOME
public BaseHome()
throws java.io.IOException
java.io.IOExceptionpublic BaseHome(java.lang.String[] cmdLine)
throws java.io.IOException
java.io.IOExceptionpublic BaseHome(CommandLineConfigSource cmdLineSource) throws java.io.IOException
java.io.IOExceptionpublic BaseHome(ConfigSources sources)
public java.lang.String getBase()
public java.nio.file.Path getBasePath()
public java.nio.file.Path getBasePath(java.lang.String path)
Path reference to some content in "${jetty.base}"path - the path to referencepublic ConfigSources getConfigSources()
public java.lang.String getHome()
public java.nio.file.Path getHomePath()
public java.nio.file.Path getPath(java.lang.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 java.util.List<java.nio.file.Path> getPaths(java.nio.file.Path dir,
int searchDepth,
java.lang.String pattern)
throws java.io.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)java.io.IOException - if unable to search the pathpublic java.util.List<java.nio.file.Path> getPaths(java.lang.String pattern)
throws java.io.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.java.io.IOException - if error during search operationpublic boolean isBaseDifferent()
public java.lang.String toShortForm(java.io.File path)
toShortForm(file.toPath())path - the path to shortenpublic java.lang.String toShortForm(java.nio.file.Path path)
"${jetty.home}" or "${jetty.base}" where appropriate.path - the path to shortenpublic java.lang.String toShortForm(java.lang.String path)
"${jetty.home}" or "${jetty.base}" where appropriate.path - the path to shortenCopyright © 1995–2022 Webtide. All rights reserved.