mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Check for symlinks when deleting directories. Allow Database.open()
and close() to throw IOExceptions as well as DatabaseExceptions.
This commit is contained in:
@@ -75,11 +75,17 @@ public class FileUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void delete(File f) {
|
||||
if(f.isDirectory()) for(File child : f.listFiles()) delete(child);
|
||||
public static void delete(File f) throws IOException {
|
||||
if(f.isDirectory() && !isSymlink(f)) {
|
||||
for(File child : f.listFiles()) delete(child);
|
||||
}
|
||||
f.delete();
|
||||
}
|
||||
|
||||
private static boolean isSymlink(File f) throws IOException {
|
||||
return org.apache.commons.io.FileUtils.isSymlink(f);
|
||||
}
|
||||
|
||||
public interface Callback {
|
||||
|
||||
void processingFile(File f);
|
||||
|
||||
Reference in New Issue
Block a user