Class TemplateUtilities

java.lang.Object
com.sun.javatest.TemplateUtilities

public class TemplateUtilities extends Object
Template support utility methods. Only meant to be used internally by JT Harness.
  • Constructor Details

    • TemplateUtilities

      public TemplateUtilities()
  • Method Details

    • getTemplateFile

      public static File getTemplateFile(WorkDirectory wd)
      Get the path to the template associated with the work dir.
      Parameters:
      wd - The work directory to query.
      Returns:
      Null if no associated template could be found. A file which refers to the template file associated with the work directories. May or may not be possible to actually open this file, the caller is responsible for determining that.
    • getTemplatePath

      public static String getTemplatePath(WorkDirectory wd)
      Get the path to the template associated with the work dir.
      Parameters:
      wd - The work directory to query.
      Returns:
      Null if no associated template could be found. An abstract path otherwise.
    • setTemplateFile

      public static void setTemplateFile(WorkDirectory wd, File t, boolean changeable) throws IOException
      Associate a template file with a work directory. None of the parameters may be null.
      Parameters:
      wd - Work dir to operate on.
      t - Template file to associate the work directory with.
      changeable - Can the workdir be later associated with a different template? Not currently used.
      Throws:
      IOException - If the complete path to the template file cannot be resolve, or if there is an error writing to the work dir.
    • getTemplateFromWd

      public static String getTemplateFromWd(File dir) throws IOException
      Using a lightweight method,, find out if and which template is associated with a work dir.
      Returns:
      Null if no template is associated. Will also be null if the given dir is not a workdir - this is something that should be checked first.
      Throws:
      IOException - If there are problems getting the template information, which usually means there is a problem reading the workdir.
    • isTemplate

      public static boolean isTemplate(File f) throws IOException
      Throws:
      IOException
    • getConfigInfo

      public static TemplateUtilities.ConfigInfo getConfigInfo(File f) throws IOException
      Throws:
      IOException