1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.tools.visualizer.postrenderers; |
11 | |
|
12 | |
import org.mule.tools.visualizer.components.PostRenderer; |
13 | |
import org.mule.tools.visualizer.config.GraphEnvironment; |
14 | |
|
15 | |
import com.oy.shared.lm.graph.Graph; |
16 | |
|
17 | |
import java.io.File; |
18 | |
import java.io.FilenameFilter; |
19 | |
import java.util.Map; |
20 | |
|
21 | 4 | public class FileCleanerPostRenderer implements PostRenderer |
22 | |
{ |
23 | |
|
24 | |
public void postRender(GraphEnvironment env, Map context, Graph graph) |
25 | |
{ |
26 | 4 | if (!env.getConfig().isKeepDotFiles()) |
27 | |
{ |
28 | 4 | File[] dotFiles = env.getConfig().getOutputDirectory().listFiles(new FilenameFilter() |
29 | |
{ |
30 | 4 | public boolean accept(File dir, String name) |
31 | |
{ |
32 | 60 | return name.endsWith(".dot") | name.endsWith(".cmapx"); |
33 | |
} |
34 | |
}); |
35 | 12 | for (int x = 0; x < dotFiles.length; x++) |
36 | |
{ |
37 | 8 | dotFiles[x].delete(); |
38 | |
} |
39 | |
} |
40 | 4 | } |
41 | |
|
42 | |
} |