Class RootPathMap

Object
RootPathMap

public class RootPathMap extends Object
A collection of root-paths indexed by their name.

Currently exists as a singleton.

Author:
Owen Feehan
  • Method Details

    • split

      public SplitPath split(Path pathIn, String rootName, boolean debugMode) throws PathDifferenceException
      Given a path, it splits the *root* portion of the path from the remainder, trying a root identified by the rootName and debugMode (and if this fails, also trying with debugMode==false)
      Parameters:
      pathIn - path to split
      rootName - identifier for a root to use
      debugMode - whether we are in debug mode or not
      Returns:
      the split-path
      Throws:
      PathDifferenceException - if the path cannot be matched against the root
    • instance

      public static RootPathMap instance()
    • addFromXmlFile

      public void addFromXmlFile(Path path) throws OperationFailedException
      Adds root-paths contained in a list of XML Beans in an xml file
      Parameters:
      path - the path to the XML file containing the root-paths
      Throws:
      OperationFailedException
    • findRoot

      public RootPath findRoot(String name, boolean debug) throws PathDifferenceException
      Finds a root to match a name and debug/status
      Parameters:
      name - this name must match
      debug - if true, priority is given to root paths which also match debug.
      Returns:
      the found root, or an exception if one cannot be found
      Throws:
      PathDifferenceException