Posts

Showing posts from June, 2008

JavaRanch Atomic Variables vs Synchronization

Embeddable SQL editor

DataStorm

Can launch from code with one line.

Delete directory

/**
* Recurse through directories if present, deleting all contents first so that the directory itself can be deleted.
*
* @param file
* @return
*/
private boolean delete(final File file) {

boolean deleted = true;
if (file.isDirectory()) {
for (final File f : file.listFiles()) {
if (f.isDirectory()) {
deleted &= delete(f);
if (!deleted) {
LOGGER.error("Coulnd't delete " + f);
return deleted;
}
} else {
deleted &= f.delete();
if (!deleted) {
LOGGER.error("Coulnd't delete " + f);
return deleted;
}
}
}
}
deleted &= file.delete();
if (!deleted) {
LOGGER.error("Coulnd't delete " + file);