1 package net.sf.mvnflexreports; 2 3 import java.io.File; 4 import java.util.List; 5 6 import org.apache.maven.reporting.AbstractMavenReport; 7 8 /*** 9 * @author RĂ©mi Flament 10 * 11 */ 12 public abstract class AbstractGraphvizMavenReport extends AbstractMavenReport { 13 14 /*** 15 * The program name for dot (can be dot, circo, neato, or any program that 16 * understand dot files) 17 * 18 * @parameter expression="dot" 19 */ 20 protected String programName; 21 22 /*** 23 * The font name for the graphviz report 24 * 25 * @parameter expression="Bitstream Vera Sans" 26 */ 27 protected String fontName; 28 29 /*** 30 * The font size for the graphviz report 31 * 32 * @parameter expression="8" 33 */ 34 protected String fontSize; 35 36 public void setFontName(String fontName) { 37 this.fontName = fontName; 38 } 39 40 public void setFontSize(String fontSize) { 41 this.fontSize = fontSize; 42 } 43 44 public void setProgramName(String programName) { 45 this.programName = programName; 46 } 47 48 protected void getFiles(File root, List<File> files, String... extensions) { 49 50 File[] fs = root.listFiles(); 51 for (int i = 0; i < fs.length; i++) { 52 File file = fs[i]; 53 54 if (file.isDirectory()) { 55 getFiles(file, files, extensions); 56 } else { 57 for (String ext : extensions) { 58 if (file.getName().toLowerCase().endsWith(ext.toLowerCase())) { 59 files.add(file); 60 break; 61 } 62 } 63 64 } 65 66 } 67 68 } 69 }