/***************************************************************************
* Copyright (c) 2004 - 2008 Fabrizio Boco fabboco@users.sourceforge.net *
* *
* *
* This is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License (version 2.1) as published by the Free Software Foundation *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
/**
- $Header: /usr/local/cvslocalrepository/SeamWebAppGenerator/src/org/boco/seamwebappgen/projectGeneration/Attic/ProjectGenerator.java,v 1.1.2.3 2008/05/05 14:30:01 fab Exp $
- $Author: fab $
- $Revision: 1.1.2.3 $
- $Date: 2008/05/05 14:30:01 $
- $Log: ProjectGenerator.java,v $
- Revision 1.1.2.3 2008/05/05 14:30:01 fab
- Modifiche alla procedura di installazione
- Modifiche per gestione entity home
-
- Revision 1.1.2.2.2.1 2008/05/05 11:53:14 fab
- *** empty log message ***
-
- Revision 1.1.2.2 2008/04/22 05:37:56 fab
- Aggiornamento indirizzo di posta
-
- Revision 1.1.2.1 2008/04/19 13:12:38 fab
- Modifiche varie per rafactoring
-
- Revision 1.1.2.1 2008/04/19 11:18:37 fab
- Refactoring
-
- Revision 1.4.2.9 2008/04/19 10:07:02 fab
- Aggiornamento riferimenti licenza
-
- Revision 1.4.2.8 2008/03/25 15:15:10 fab
- *** empty log message ***
-
- Revision 1.4.2.7 2008/03/25 13:50:49 fab
- *** empty log message ***
-
- Revision 1.4.2.6 2008/03/24 08:30:57 fab
- *** empty log message ***
-
- Revision 1.4.2.5 2008/03/22 16:51:58 fab
- *** empty log message ***
-
- Revision 1.4.2.4 2008/03/17 09:23:41 fab
- *** empty log message ***
-
- Revision 1.4.2.3 2008/02/23 13:40:54 fab
- *** empty log message ***
-
- Revision 1.4.2.2 2008/02/20 21:31:06 fab
- *** empty log message ***
-
- Revision 1.4.2.1 2008/02/20 18:32:36 fab
- *** empty log message ***
-
- Revision 1.3.2.4 2008/02/10 17:56:37 fab
- *** empty log message ***
-
- Revision 1.3.2.3 2008/02/09 17:31:45 fab
- Corretta generazione del progetto
-
- Revision 1.3.2.2 2008/02/07 10:42:21 fab
- *** empty log message ***
-
- Revision 1.4 2008/02/02 06:49:41 fab
- Fix creazione validatore custom delle stringhe
-
- Revision 1.3.2.1 2008/02/02 06:47:32 fab
- Fix creazione validatore custom delle stringhe
-
- Revision 1.3 2007/12/21 11:07:05 fab
- Dopo merge per supporto jboss 4.2.2
-
- Revision 1.2.2.4 2007/12/17 20:52:23 fab
- Fix supporto per Jboss Tools 2.0 - Generazione packaging
-
- Revision 1.2.2.3 2007/12/17 19:51:50 fab
- Supporto per Jboss Tools 2.0
-
- Revision 1.2.2.2 2007/12/17 19:46:51 fab
- Modifiche derivanti dalla presenza di una sola vista principale
-
- Revision 1.2.2.1 2007/12/17 07:39:18 fab
- Implementazione generazione vista principale durante la generazione e non nella creazione del progetto (0405/C)
-
- Revision 1.2 2007/12/02 07:34:15 fab
- *** empty log message ***
-
- Revision 1.1 2007/09/29 13:17:26 fab
- Nuova versione iniziale del 29/09/2007
-
- Revision 1.4.2.11 2007/09/08 11:14:33 fab
- Aggiornamento scheletro progetto
-
- Revision 1.4.2.10 2007/08/30 13:26:47 fab
- Fix per la cancellazione dei file temporanei su windows
-
- Revision 1.4.2.9 2007/07/22 07:53:37 fab
- Fix per SEAM 2
-
- Revision 1.4.2.8 2007/06/09 13:44:12 fab
- Fix vari per la generazione del progetto
-
- Revision 1.4.2.7 2007/05/19 09:33:31 dev
- Moltissime modifiche
-
- Revision 1.4.2.6 2007/04/24 09:00:43 dev
- Fix vari tra cui inserimento del BeanManager per le query libere
-
- Revision 1.4.2.5 2007/04/03 06:05:09 dev
- Fix alla documentazione
-
- Revision 1.4.2.4 2007/03/24 17:25:11 dev
- Modifica per aggiornare Index.html in fase di creazione del progetto
-
- Revision 1.4.2.3 2007/03/24 12:25:17 dev
- Creazione della vista iniziale
-
- Revision 1.4.2.2 2007/03/24 00:41:16 dev
- Reingegnerizzazione della creazione del progetto
-
- Revision 1.4.2.1 2007/02/24 16:02:18 dev
- Modifiche per supportare le conditional validation
-
- Revision 1.4 2006/12/17 15:04:39 dev
- Aggiornata la documentazione
-
- Revision 1.3 2006/12/17 15:01:24 dev
- Correzione per la corretta cancellazione delle directory CVS copiate dallo scheletro
-
- Revision 1.2 2006/12/17 00:26:27 dev
- Fix
-
- Revision 1.1 2006/12/16 22:53:16 dev
- Versione Iniziale
-
**/
package org.boco.seamwebappgen.projectGeneration;
import java.awt.Color;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Collection;
import java.util.jar.JarFile;
import javax.swing.JProgressBar;
import javax.swing.JTextArea;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.boco.seamwebappgen.utils.JarFileReader;
/**
* Generatore dello scheletro di un nuovo progetto
*
* @author Fabrizio Boco
*/
public class ProjectGenerator implements Runnable
{
private String applicationName;
private String sourceDir = "";
private String basePackage;
private JTextArea messageArea;
private JProgressBar progressBar;
/**
* Crea una istanza del generatore del progetto
*
*/
public ProjectGenerator(String applicationName, String sourceDir, String basePackage, JProgressBar progressBar, JTextArea messageArea)
{
if (sourceDir.endsWith(File.separator))
this.sourceDir = sourceDir;
else
this.sourceDir = sourceDir + File.separator;
this.applicationName = applicationName;
this.basePackage = basePackage;
this.messageArea = messageArea;
this.progressBar = progressBar;
}
/**
* Genera un nuovo progetto
*/
public void run()
{
Long startTime = System.currentTimeMillis();
int idx = 0;
messageArea.setText("");
int creatingObjectNumber = 16;
progressBar.setIndeterminate(true);
progressBar.setMinimum(0);
progressBar.setMaximum(creatingObjectNumber - 1);
progressBar.setValue(idx);
progressBar.setIndeterminate(false);
progressBar.setForeground(Color.BLUE);
progressBar.setStringPainted(true);
try
{
// System.out.println("-1");
File sourceDirectory = new File(sourceDir + File.separator + "src");
// Crea la directory di deployment
// System.out.println("0");
File deployDir = new File(sourceDir + File.separator + "deploy");
deployDir.mkdir();
messageArea.setText("Creazione deploy");
progressBar.setValue(idx++);
// Creazione del contenuto della directory src
// System.out.println("1");
File srcSkeletonDir = new File("." + File.separator + "projectSkeleton" + File.separator + "src");
try
{
FileUtils.copyDirectoryToDirectory(srcSkeletonDir, new File(sourceDir));
}
catch (FileNotFoundException e)
{
// System.out.println("Copia dal jar");
JarFileReader jr = new JarFileReader();
try
{
JarFile jarFile = jr.getJarFile();
jr.copyDirectoryToDirectory(jarFile, "projectSkeleton" + File.separator + "src", sourceDir);
}
catch (IOException exx)
{
exx.printStackTrace();
}
}
// System.out.println("2");
messageArea.setText("Creazione " + sourceDir + File.separator + "src e suo contenuto");
progressBar.setValue(idx++);
// Sposta il contenuto della directory packageName nella directory con il nome effettivo del package
File standardPackageDir = new File(sourceDirectory.getAbsolutePath() + File.separator + "packageName");
try
{
FileUtils.copyDirectory(standardPackageDir, new File(sourceDirectory.getAbsolutePath() + File.separator + basePackage));
FileUtils.cleanDirectory(standardPackageDir);
standardPackageDir.deleteOnExit();
}
catch (FileNotFoundException e)
{
}
// System.out.println("3");
messageArea.setText("Trasferito il contenuto della directory src");
progressBar.setValue(idx++);
// Creazione Directory documentation
File documentationDirectory = new File(sourceDir + File.separator + "documentation");
if (!documentationDirectory.exists())
{
documentationDirectory.mkdirs();
messageArea.setText("Creazione " + sourceDir + File.separator + "documentation");
}
progressBar.setValue(idx++);
/**
* Copia lo scheletro di html
*/
File htmlSkeletonDir = new File("." + File.separator + "projectSkeleton" + File.separator + "html");
try
{
FileUtils.copyDirectoryToDirectory(htmlSkeletonDir, new File(sourceDir));
}
catch (FileNotFoundException e)
{
// System.out.println("Copia dal jar");
JarFileReader jr = new JarFileReader();
try
{
JarFile jarFile = jr.getJarFile();
jr.copyDirectoryToDirectory(jarFile, "projectSkeleton" + File.separator + "html", sourceDir);
}
catch (IOException exx)
{
exx.printStackTrace();
}
}
// System.out.println("4");
messageArea.setText("Creazione contenuto html");
progressBar.setValue(idx++);
/**
* Copia lo scheletro di lib
*/
// File libSkeletonDir = new File("." + File.separator + "projectSkeleton" + File.separator + "lib");
// FileUtils.copyDirectoryToDirectory(libSkeletonDir, new File(sourceDir));
// messageArea.setText("Creazione contenuto lib");
//
// progressBar.setValue(idx++);
/**
* Copia lo scheletro di resources
*/
File resourcesSkeletonDir = new File("." + File.separator + "projectSkeleton" + File.separator + "resources");
try
{
FileUtils.copyDirectoryToDirectory(resourcesSkeletonDir, new File(sourceDir));
}
catch (FileNotFoundException e)
{
// System.out.println("Copia dal jar");
JarFileReader jr = new JarFileReader();
try
{
JarFile jarFile = jr.getJarFile();
jr.copyDirectoryToDirectory(jarFile, "projectSkeleton" + File.separator + "resources", sourceDir);
}
catch (IOException exx)
{
exx.printStackTrace();
}
}
// System.out.println("5");
messageArea.setText("Creazione contenuto resources");
progressBar.setValue(idx++);
/**
* Copia i file di Eclipse
*/
try
{
FileUtils.copyFileToDirectory(new File("." + File.separator + "projectSkeleton" + File.separator + ".classpath"), new File(sourceDir));
}
catch (FileNotFoundException e)
{
// System.out.println("Copia dal jar");
JarFileReader jr = new JarFileReader();
try
{
JarFile jarFile = jr.getJarFile();
jr.copyFileToDirectory(jarFile, "projectSkeleton" + File.separator + ".classpath", sourceDir);
}
catch (IOException exx)
{
exx.printStackTrace();
}
}
// System.out.println("6");
try
{
FileUtils.copyFileToDirectory(new File("." + File.separator + "projectSkeleton" + File.separator + ".packages"), new File(sourceDir));
}
catch (FileNotFoundException e)
{
// System.out.println("Copia dal jar");
JarFileReader jr = new JarFileReader();
try
{
JarFile jarFile = jr.getJarFile();
jr.copyFileToDirectory(jarFile, "projectSkeleton" + File.separator + ".packages", sourceDir);
}
catch (IOException exx)
{
exx.printStackTrace();
}
}
// Modifica nel file di packaging il nome dell'applicazione
//String buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + ".packaging"), null);
String buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + ".packages"), null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
buffer = buffer.replaceAll("@SourceDir", sourceDir);
String tmpPath = sourceDir.substring(0,sourceDir.length()-1);
// System.out.println("tmpPath "+tmpPath);
// System.out.println("pathSeparator "+File.separator);
int lastForwardSlash = tmpPath.lastIndexOf(File.separator);
// System.out.println("lastForwardSlash "+lastForwardSlash);
String projectDir = tmpPath.substring(lastForwardSlash+1,tmpPath.length());
// System.out.println("projectDir "+projectDir);
buffer = buffer.replaceAll("@ProjectDir", projectDir);
//FileUtils.writeStringToFile(new File(sourceDir + File.separator + ".packaging"), buffer, null);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + ".packages"), buffer, null);
messageArea.setText("Copiati i file del progetto Eclipse");
progressBar.setValue(idx++);
// Cancella le eventuali directory CVS create con la copia del template
deleteCVSDirectories(sourceDir);
progressBar.setValue(idx++);
// Sostituzione dei tag in alcuni file
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "html" + File.separator + "WEB-INF" + File.separator + "components.xml"), null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "html" + File.separator + "WEB-INF" + File.separator + "components.xml"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "jboss-app.xml"), null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "jboss-app.xml"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "persistence.xml"), null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "persistence.xml"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "application.xml"), null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "resources" + File.separator + "META-INF" + File.separator + "application.xml"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "ApplicationRole.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "ApplicationRole.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "ApplicationUser.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "ApplicationUser.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "ApplicationUserManagerBean.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "ApplicationUserManagerBean.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "ApplicationUserManager.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "ApplicationUserManager.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "remote" + File.separator + "ApplicationUserManagerRemote.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "remote" + File.separator + "ApplicationUserManagerRemote.java"), buffer, null);
messageArea.setText("Sostituiti i tag");
progressBar.setValue(idx++);
/** Entity Bean per configurazione **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "Configuration.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "entity" + File.separator + "Configuration.java"), buffer, null);
messageArea.setText("Creato bean per la configurazione");
progressBar.setValue(idx++);
/** Session Bean per autenticazione **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "Authenticator.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "Authenticator.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "AuthenticatorBean.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "AuthenticatorBean.java"), buffer, null);
messageArea.setText("Creato bean per l'autenticazione");
progressBar.setValue(idx++);
/** Classe per encryption **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "DesEncrypter.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "security" + File.separator + "DesEncrypter.java"), buffer, null);
messageArea.setText("Creata classe per encryption");
progressBar.setValue(idx++);
/** Session Bean per query libere **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "QueryManager.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "QueryManager.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "QueryManagerBean.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "QueryManagerBean.java"), buffer, null);
messageArea.setText("Creata classe per encryption");
progressBar.setValue(idx++);
/** Session Bean Manager per configurazione **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "ConfigurationManager.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "ConfigurationManager.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "ConfigurationManagerBean.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "ConfigurationManagerBean.java"), buffer, null);
messageArea.setText("Creato bean manager per la configurazione");
progressBar.setValue(idx++);
/** Session Bean per gestione dinamica vista principale **/
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "MainListManager.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "managerInterface" + File.separator + "MainListManager.java"), buffer, null);
buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "MainListManagerBean.java"), null);
buffer = buffer.replaceAll("@basePackage", basePackage);
buffer = buffer.replaceAll("@YourCode", "");
FileUtils.writeStringToFile(new File(sourceDir + File.separator + "src" + File.separator + basePackage + File.separator + "manager" + File.separator + "MainListManagerBean.java"), buffer, null);
messageArea.setText("Creato bean manager per la vista principale");
progressBar.setValue(idx++);
// InfoReader infoReader = new InfoReader(sourceDir + File.separator + "bin");
// ShowList mainList = infoReader.getMainList();
//
// if (mainList != null)
// {
// buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "html" + File.separator + "index.html"), null);
// buffer = buffer.replaceAll("@MainShowList", mainList.getName());
// FileUtils.writeStringToFile(new File(sourceDir + File.separator + "html" + File.separator + "index.html"), buffer, null);
//
// buffer = FileUtils.readFileToString(new File(sourceDir + File.separator + "html" + File.separator + "Index.xhtml"), null);
// buffer = buffer.replaceAll("@MainShowList", mainList.getName());
// FileUtils.writeStringToFile(new File(sourceDir + File.separator + "html" + File.separator + "Index.xhtml"), buffer, null);
// }
// Modifica del file con il data source
File dataSourceFile = new File(sourceDir + File.separator + "src" + File.separator + "application-ds.xml");
buffer = FileUtils.readFileToString(dataSourceFile, null);
buffer = buffer.replaceAll("@ApplicationName", applicationName);
FileUtils.writeStringToFile(dataSourceFile, buffer, null);
dataSourceFile.renameTo(new File(sourceDir + File.separator + "src" + File.separator + applicationName + "-ds.xml"));
messageArea.setText("Creato il file per il data source");
progressBar.setValue(idx++);
Long elapsed = System.currentTimeMillis() - startTime;
messageArea.setText("OK\r\nElapsed time: " + elapsed + " ms - " + (elapsed / 1000) + " s - " + (elapsed / 1000 / 60) + " min");
}
catch (Exception e)
{
e.printStackTrace();
messageArea.setText(e.getMessage());
return;
}
}
/**
* Cancella le directory CVS che sono state copiate nel nuovo progetto dallo scheletro
* del generatore
*/
private void deleteCVSDirectories(String startDirName) throws IOException
{
File startDir = new File(startDirName);
Collection<File> cFiles = FileUtils.listFiles(startDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
for (File file : cFiles)
{
if (file.getAbsolutePath().contains("CVS"))
{
int end = FilenameUtils.indexOfLastSeparator(file.getAbsolutePath());
File cvsDir = new File(File.separator + file.getAbsolutePath().substring(1, end) + File.separator);
FileUtils.deleteDirectory(cvsDir);
}
}
}
}