public final class SolrPaths extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertPathAllowed(Path pathToAssert,
Set<Path> allowPaths)
Checks that the given path is relative to one of the allowPaths supplied.
|
static Path |
locateSolrHome()
Deprecated.
all code should get solr home from CoreContainer
|
static String |
normalizeDir(String path)
Ensures a directory name always ends with a '/'.
|
@Deprecated public static Path locateSolrHome()
The return value is normalized. Normalization essentially means it ends in a trailing slash.
normalizeDir(String)
,
CoreContainer.getSolrHome()
public static String normalizeDir(String path)
public static void assertPathAllowed(Path pathToAssert, Set<Path> allowPaths) throws SolrException
CoreContainer.assertPathAllowed(Path)
and allowPaths pre-filled with the node's
SOLR_HOME, SOLR_DATA_HOME and coreRootDirectory folders, as well as any paths specified in
solr.xml's allowPaths element. The following paths will always fail validation:
..
\\host\share\path
)pathToAssert
- path to checkallowPaths
- list of paths that should be allowed prefixes for pathToAssertSolrException
- if path is outside allowed pathsCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.