public void pruneEmptyDirs ( File targetFile ) { while ( isParentAnEmptyDirectory ( targetFile ) ) { try { targetFile . getParentFile ( ) . delete ( ) ; targetFile = targetFile . getParentFile ( ) ; } catch ( Exception e ) { // } } }
prune empty dir