Update of /cvsroot/fudaa/fudaa_devel/aide/src/prepro/template/task
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18294/template/task
Modified Files:
FileList.java
Added Files:
.cvsignore
Log Message:
maj de l'aide version 0.05
--- NEW FILE: .cvsignore ---
FileList.class
Index: FileList.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/aide/src/prepro/template/task/FileList.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileList.java 21 Jan 2004 10:42:32 -0000 1.1
--- FileList.java 12 Feb 2004 15:19:38 -0000 1.2
***************
*** 12,15 ****
--- 12,17 ----
protected Vector filesets= new Vector();
protected String file= null;
+ protected String includes= null;
+ protected String excludes= null;
public FileList() {}
***************
*** 17,24 ****
// The method executing the task
public void execute() throws BuildException {
! DirectoryScanner s=new DirectoryScanner();
s.addDefaultExcludes();
! s.setExcludes(new String[]{file});
! for (int i= filesets.size()-1; i >=0 ; i--) {
DirSet fs= (DirSet)filesets.elementAt(i);
DirectoryScanner ds= fs.getDirectoryScanner(project);
--- 19,27 ----
// The method executing the task
public void execute() throws BuildException {
! DirectoryScanner s= new DirectoryScanner();
! s.setIncludes(computeIncludes(includes));
! s.setExcludes(computeExcludes());
s.addDefaultExcludes();
! for (int i= filesets.size() - 1; i >= 0; i--) {
DirSet fs= (DirSet)filesets.elementAt(i);
DirectoryScanner ds= fs.getDirectoryScanner(project);
***************
*** 26,61 ****
String[] dirFiles= ds.getIncludedDirectories();
for (int j= dirFiles.length - 1; j >= 0; j--) {
! File destFile=new File(fromDir,dirFiles[j]);
s.setBasedir(destFile);
s.scan();
! writeListFile(destFile,s.getIncludedFiles());
! }
}
}
!
!
! private void writeListFile(File destDir,String[] filenames){
! Writer out=null;
try {
! out= new FileWriter(new File(destDir,file));
for (int j= filenames.length - 1; j >= 0; j--) {
! out.write("<a href=\""+new File(destDir,filenames[j]).getAbsolutePath()+"\">"+filenames[j]+"</a>\n");
}
! } catch (IOException _e) {}
! finally{
! if(out!=null){
! try{
! out.close();
! }
! catch(Exception e){
! e.printStackTrace();
! }
! }
! }
}
!
public void setFile(String _f) {
! file=_f;
}
public void addDirset(DirSet set) {
filesets.addElement(set);
--- 29,107 ----
String[] dirFiles= ds.getIncludedDirectories();
for (int j= dirFiles.length - 1; j >= 0; j--) {
! File destFile= new File(fromDir, dirFiles[j]);
s.setBasedir(destFile);
s.scan();
! writeListFile(destFile, s.getIncludedFiles());
}
}
! }
!
!
! public static String[] computeIncludes(String _s){
! if(_s!=null){
! StringTokenizer s=new StringTokenizer(_s,",");
! String[] r=new String[s.countTokens()];
! int i=0;
! while(s.hasMoreTokens()){
! r[i++]=s.nextToken();
! }
! return r;
! }
! return null;
! }
!
! public String[] computeExcludes(){
! if(excludes!=null){
! StringTokenizer s=new StringTokenizer(excludes,",");
! String[] r=new String[s.countTokens()+1];
! int i=0;
! r[i++]=file;
! while(s.hasMoreTokens()){
! r[i++]=s.nextToken();
! }
! return r;
! }
! return new String[] { file };
! }
!
!
!
! private void writeListFile(File destDir, String[] filenames) {
! Writer out= null;
try {
! out= new FileWriter(new File(destDir, file));
! out.write("<div>");
for (int j= filenames.length - 1; j >= 0; j--) {
! out.write(
! "<a href=\""
! + new File(destDir, filenames[j]).getAbsolutePath()
! + "\">"
! + filenames[j]
! + "</a>\n");
}
! out.write("</div>");
! } catch (IOException _e) {} finally {
! if (out != null) {
! try {
! out.close();
! } catch (Exception e) {
! e.printStackTrace();
! }
! }
! }
}
!
public void setFile(String _f) {
! file= _f;
! }
!
! public void setIncludes(String _f) {
! includes= _f;
! }
!
! public void setExcludes(String _f) {
! excludes= _f;
}
+
public void addDirset(DirSet set) {
filesets.addElement(set);
|