You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by br...@apache.org on 2012/10/30 23:59:40 UTC
[9/24] git commit: FLUME-1664. Logutils.getLogs remove unneeded
directory check.
FLUME-1664. Logutils.getLogs remove unneeded directory check.
(Brock Noland via Hari Shreedharan)
Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/af34b7bf
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/af34b7bf
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/af34b7bf
Branch: refs/heads/FLUME-1502
Commit: af34b7bf308779640b60a3508d9fb667f19c751c
Parents: 8f6d1a1
Author: Hari Shreedharan <hs...@apache.org>
Authored: Thu Oct 25 23:26:44 2012 -0400
Committer: Hari Shreedharan <hs...@apache.org>
Committed: Thu Oct 25 23:26:44 2012 -0400
----------------------------------------------------------------------
.../org/apache/flume/channel/file/LogUtils.java | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flume/blob/af34b7bf/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
index 4f5d3cc..d1498c2 100644
--- a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
+++ b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogUtils.java
@@ -65,14 +65,11 @@ public class LogUtils {
List<File> result = Lists.newArrayList();
File[] files = logDir.listFiles();
if(files == null) {
- if(!logDir.isDirectory()) {
- String msg = "Path " + logDir + " is not a directory: ";
- msg += "File = " + logDir.isFile() + ", ";
- msg += "Exists = " + logDir.exists() + ", ";
- msg += "Writable = " + logDir.canWrite();
- throw new IllegalStateException(msg);
- }
- return result;
+ String msg = logDir + ".listFiles() returned null: ";
+ msg += "File = " + logDir.isFile() + ", ";
+ msg += "Exists = " + logDir.exists() + ", ";
+ msg += "Writable = " + logDir.canWrite();
+ throw new IllegalStateException(msg);
}
for (File file : files) {
String name = file.getName();