jawr-ant/src/main/java/net/jawr/ant/BundleTask.java
/**
     * Clean a directory without deleting it.
     */
Clean a directory without deleting it.
Clean a directory without deleting it .
public void cleanDirectory( final File directory )
        throws IOException
    {
        if ( !directory.exists() )
        {
            final String message = directory + " does not exist";
            throw new IllegalArgumentException( message );
        }
        if ( !directory.isDirectory() )
        {
            final String message = directory + " is not a directory";
            throw new IllegalArgumentException( message );
        }
        Delete deleteTask = new Delete();
        deleteTask.setProject(getProject());
		deleteTask.setDir(directory);
		deleteTask.execute();
		if(!directory.exists()){
			directory.mkdirs();
		}
    }
public void cleanDirectory ( final File directory ) throws IOException { if ( ! directory . exists ( ) ) { final String message = directory + " does not exist" ; throw new IllegalArgumentException ( message ) ; } if ( ! directory . isDirectory ( ) ) { final String message = directory + " is not a directory" ; throw new IllegalArgumentException ( message ) ; } Delete deleteTask = new Delete ( ) ; deleteTask . setProject ( getProject ( ) ) ; deleteTask . setDir ( directory ) ; deleteTask . execute ( ) ; if ( ! directory . exists ( ) ) { directory . mkdirs ( ) ; } }
Clean a directory without deleting it.
Clean a directory without deleting it .