public final class SolrPaths extends Object
|Modifier and Type||Method and Description|
Checks that the given path is relative to one of the allowPaths supplied.
all code should get solr home from CoreContainer
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.
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:
pathToAssert- path to check
allowPaths- list of paths that should be allowed prefixes for pathToAssert
SolrException- if path is outside allowed paths
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.