From 34a0457945c79c4c85bc44da90912b671b49cd7e Mon Sep 17 00:00:00 2001
From: brinn <brinn>
Date: Thu, 29 Nov 2007 19:55:40 +0000
Subject: [PATCH] merged from from datamover/1.0.x, r2787 add: check if thread
 has been interrupted and throw exception if it has been

SVN: 2860
---
 .../ch/systemsx/cisd/common/utilities/FileUtilities.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java b/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java
index f3533293f0f..3ec8b5420c7 100644
--- a/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java
+++ b/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java
@@ -438,6 +438,8 @@ public final class FileUtilities
      * @return The time when any file in (or below) <var>path</var> has last been changed in the file system.
      * @throws CheckedExceptionTunnel of an {@link IOException} if the <var>path</var> does not exist or is not
      *             readable.
+     * @throws CheckedExceptionTunnel of an {@link InterruptedException} if the thread that the method runs in gets
+     *             interrupted.
      */
     public static long lastChanged(File path)
     {
@@ -454,6 +456,10 @@ public final class FileUtilities
         {
             for (File subDirectory : getSubDirectories(path))
             {
+                if (Thread.interrupted())
+                {
+                    throw new CheckedExceptionTunnel(new InterruptedException("lastChanged() interrupted"));
+                }
                 lastChanged = Math.max(lastChanged, lastChanged(subDirectory));
             }
         }
-- 
GitLab