Class ConfigurationTree

java.lang.Object
loci.tests.testng.ConfigurationTree

public class ConfigurationTree extends Object
Stores configuration data about files in a directory structure. This class is not designed to be thread safe, so should be synchronized externally for proper thread safety.
  • Constructor Details

    • ConfigurationTree

      public ConfigurationTree(String rootDir)
      Constructs a new configuration tree rooted at the given directory in the file system.
      Parameters:
      rootDir - a string specifying the root directory
    • ConfigurationTree

      public ConfigurationTree(String rootDir, String configDir)
      Constructs a new configuration tree rooted at the given directory in the file system with a custom configuration directory.
      Parameters:
      rootDir - a string specifying the root directory
      configDir - a string specifying the base configuration directory
    • ConfigurationTree

      public ConfigurationTree(String rootDir, String configDir, String cacheDir)
      Constructs a new configuration tree rooted at the given directory in the file system with a custom configuration directory anc cache directory.
      Parameters:
      rootDir - a string specifying the root directory
      configDir - a string specifying the base configuration directory
      cacheDir - a string specifying the cache directory
  • Method Details

    • getRootDirectory

      public String getRootDirectory()
      Returns the toot directory holding the data
    • getConfigDirectory

      public String getConfigDirectory()
      Returns the base directory holding the configuration files
    • getCacheDirectory

      public String getCacheDirectory()
      Returns the base directory holding the configuration files
    • relocate

      public String relocate(String path, String oldRoot, String newRoot)
      Relocate a path from an base directory into a target directory
    • relocateToConfig

      public String relocateToConfig(String path)
      Relocate a path under the root directory to the configuration directory
    • relocateToRoot

      public String relocateToRoot(String path)
      Relocate a path under the configuration directory to the root directory
    • get

      public Configuration get(String id) throws IOException
      Retrieves the Configuration object corresponding to the given file.
      Throws:
      IOException
    • parseConfigFile

      public void parseConfigFile(String configFile) throws IOException
      Throws:
      IOException