1 26 27 package org.objectweb.jonas.ant.cluster; 28 29 import java.io.File ; 30 import java.util.ArrayList ; 31 import java.util.Iterator ; 32 import java.util.List ; 33 34 import org.apache.tools.ant.types.FileSet; 35 36 import org.objectweb.jonas.ant.jonasbase.Lib; 37 38 42 public class LibCluster extends ClusterTasks { 43 44 47 private static final String INFO = "[LibCluster] "; 48 49 52 private List files = new ArrayList (); 53 54 57 private File destDir = null; 58 59 62 public LibCluster() { 63 super(); 64 } 65 66 70 public void addConfiguredFileSet(FileSet file) { 71 files.add(file); 72 } 73 74 78 public void setDestDir(File destDir) { 79 this.destDir = destDir; 80 } 81 82 85 public void generatesTasks() { 86 87 for (int i = getDestDirSuffixIndFirst(); i <= getDestDirSuffixIndLast(); i++) { 88 89 String destDir = getDestDir(getDestDirPrefix(), i); 90 log(INFO + "tasks generation for " + destDir); 91 92 Lib lib = new Lib(); 94 95 for (Iterator it = files.iterator(); it.hasNext();) { 96 FileSet fileSet = (FileSet) it.next(); 97 lib.addFileset(fileSet); 98 if (this.destDir == null) { 99 lib.setDestDir(new File (destDir)); 100 } else { 101 lib.setTodir(this.destDir); 103 } 104 105 addTask(lib); 106 } 107 } 108 } 109 } | Popular Tags |