MCPcopy Index your code
hub / github.com/apache/tomcat / execute

Method execute

java/org/apache/tomcat/buildutil/Txt2Html.java:91–120  ·  view source on GitHub ↗

Perform the conversion @throws BuildException if an error occurs during execution of this task.

()

Source from the content-addressed store, hash-verified

89 * @throws BuildException if an error occurs during execution of this task.
90 */
91 @Override
92 public void execute() throws BuildException {
93 int count = 0;
94
95 // Step through each file and convert.
96 for (FileSet fs : filesets) {
97 DirectoryScanner ds = fs.getDirectoryScanner(getProject());
98 File basedir = ds.getBasedir();
99 String[] files = ds.getIncludedFiles();
100 for (String file : files) {
101 File from = new File(basedir, file);
102 File to = new File(todir, file + ".html");
103 if (!to.exists() || (from.lastModified() > to.lastModified())) {
104 log("Converting file '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath(),
105 Project.MSG_VERBOSE);
106 try {
107 convert(from, to);
108 } catch (IOException ioe) {
109 throw new BuildException(
110 "Could not convert '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath() + "'",
111 ioe);
112 }
113 count++;
114 }
115 }
116 if (count > 0) {
117 log("Converted " + count + " file" + (count > 1 ? "s" : "") + " to " + todir.getAbsolutePath());
118 }
119 }
120 }
121
122 /**
123 * Perform the actual copy and conversion

Callers

nothing calls this directly

Calls 5

convertMethod · 0.95
getProjectMethod · 0.80
existsMethod · 0.65
logMethod · 0.65
getAbsolutePathMethod · 0.45

Tested by

no test coverage detected