Package com.sun.javatest
Class TemplateUtilities
java.lang.Object
com.sun.javatest.TemplateUtilities
Template support utility methods. Only meant to be used internally by
JT Harness.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateUtilities.ConfigInfo
static File
Get the path to the template associated with the work dir.static String
getTemplateFromWd
(File dir) Using a lightweight method,, find out if and which template is associated with a work dir.static String
Get the path to the template associated with the work dir.static boolean
isTemplate
(File f) static void
setTemplateFile
(WorkDirectory wd, File t, boolean changeable) Associate a template file with a work directory.
-
Constructor Details
-
TemplateUtilities
public TemplateUtilities()
-
-
Method Details
-
getTemplateFile
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
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
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
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
- Throws:
IOException
-
getConfigInfo
- Throws:
IOException
-