You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by ev...@apache.org on 2004/08/26 13:50:39 UTC

cvs commit: maven-components/maven-mboot2/src/main/java FileUtils.java MBoot.java

evenisse    2004/08/26 04:50:39

  Modified:    maven-mboot2/src/main/java FileUtils.java MBoot.java
  Log:
  The test of existence of directory must be in forceDelete methods
  
  Revision  Changes    Path
  1.2       +11 -1     maven-components/maven-mboot2/src/main/java/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/FileUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileUtils.java	26 Jul 2004 03:53:16 -0000	1.1
  +++ FileUtils.java	26 Aug 2004 11:50:39 -0000	1.2
  @@ -912,6 +912,11 @@
       public static void forceDelete( final File file )
           throws IOException
       {
  +        if ( ! file.exists() )
  +        {
  +            return;
  +        }
  +
           if ( file.isDirectory() )
           {
               deleteDirectory( file );
  @@ -934,6 +939,11 @@
       public static void forceDeleteOnExit( final File file )
           throws IOException
       {
  +        if ( ! file.exists() )
  +        {
  +            return;
  +        }
  +
           if ( file.isDirectory() )
           {
               deleteDirectoryOnExit( file );
  
  
  
  1.20      +1 -4      maven-components/maven-mboot2/src/main/java/MBoot.java
  
  Index: MBoot.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/MBoot.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- MBoot.java	26 Aug 2004 11:47:30 -0000	1.19
  +++ MBoot.java	26 Aug 2004 11:50:39 -0000	1.20
  @@ -402,10 +402,7 @@
   
           // clean
           System.out.println( "Cleaning " + buildDirFile + "..." );
  -        if ( buildDirFile.exists() )
  -        {
  -            FileUtils.forceDelete( buildDirFile );
  -        }
  +        FileUtils.forceDelete( buildDirFile );
   
           // ----------------------------------------------------------------------
           // Download deps