incubator-droids-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r1440925 - /incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java
Date Thu, 31 Jan 2013 12:10:58 GMT
Author: thorsten
Date: Thu Jan 31 12:10:57 2013
New Revision: 1440925

URL: http://svn.apache.org/viewvc?rev=1440925&view=rev
Log:
Reducing exceptions expected by worker. Only allowing droidsExceptions.

Modified:
    incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java

Modified: incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java?rev=1440925&r1=1440924&r2=1440925&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java
(original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-walker/src/main/java/org/apache/droids/walker/FileWorker.java
Thu Jan 31 12:10:57 2013
@@ -34,25 +34,30 @@ public class FileWorker implements Worke
     }
 
     @Override
-    public void execute(FileTask task) throws IOException, DroidsException {
-        File file = task.getFile();
-        if (file.isDirectory()) {
-            File[] files = file.listFiles();
-            if (files != null) {
-                for (File f : files) {
-                    FileTask newTask = droid.filter(new FileTask(f, task.getDepth() + 1));
-                    if (newTask != null)
-                        droid.add(newTask);
+    public void execute(FileTask task) throws DroidsException {
+        try {
+            File file = task.getFile();
+            if (file.isDirectory()) {
+                File[] files = file.listFiles();
+                if (files != null) {
+                    for (File f : files) {
+                        FileTask newTask =
+                            droid.filter(new FileTask(f, task.getDepth() + 1));
+                        if (newTask != null)
+                            droid.add(newTask);
+                    }
                 }
+            } else {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("FILE: " + file.getAbsolutePath());
+                }
+                droid.load(task);
+                droid.parse(task);
+                droid.handle(task);
+                droid.finish(task);
             }
-        } else {
-            if (logger.isDebugEnabled()) {
-                logger.debug("FILE: " + file.getAbsolutePath());
-            }
-            droid.load(task);
-            droid.parse(task);
-            droid.handle(task);
-            droid.finish(task);
+        } catch (Exception e) {
+            throw new DroidsException(e);
         }
     }
 }



Mime
View raw message