Using ANT
, how can i make sure that directory exists before attempting to remove it?
As part of my current clean task, i
You can use this brute force technique as pure ant, which is specially useful in maven where the additional conditionals aren't available.
The mkdir will do nothing if the directory already exists, and the delete will fail if the folder cannot be deleted for some reason. The condition of the file not being there is common in a build script where one of the build steps fail but the initial clean was performed.