diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-03-02 15:12:47 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-03-02 15:12:47 +0000 |
| commit | ce17ef36e3517d0c5506233d45764818f1a2ad57 (patch) | |
| tree | 009becc487ba8a43018b3bb47054911a4f662d11 /qpid/java/common | |
| parent | 6457256413d8d7360bca260dafe1975962dd6cbc (diff) | |
| download | qpid-python-ce17ef36e3517d0c5506233d45764818f1a2ad57.tar.gz | |
Added check for when file reference becomes null, occurs if the file is externally deleted. Also noted success return value was never propogated correctly, Updated : Test needed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@749330 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common')
| -rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java b/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java index 3e13259ee3..3d43b9d511 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java @@ -250,12 +250,17 @@ public class FileUtils { if (recursive) { - for (File subFile : file.listFiles()) + try{ + for (File subFile : file.listFiles()) + { + success = delete(subFile, true) & success ; + } + }catch (NullPointerException npe) { - success = delete(subFile, true) & success ; + success = false; } - return file.delete(); + return success && file.delete(); } return false; |
