]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/file/DirectorySizeTracker.java
Improved tracking robustness with temporary files
[simantics/platform.git] / bundles / org.simantics.utils.datastructures / src / org / simantics / utils / datastructures / file / DirectorySizeTracker.java
index 4746afc89df044097c7cac450ebb3dfbffea2c9b..4aca5bd8db5418f6381f337dec14ba7214dd33e0 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *     Semantum Oy - #7330 - initial API and implementation
+ *     Semantum Oy - #7551 - improved robustness
  *******************************************************************************/
 package org.simantics.utils.datastructures.file;
 
@@ -315,6 +316,9 @@ public class DirectorySizeTracker implements Runnable, Closeable {
                                                        else if (attrs.isRegularFile()) {
                                                                registerFile(dir, child, attrs);
                                                        }
+                                               } catch (NoSuchFileException ioe) {
+                                                       // Intentionally ignore.
+                                                       // The file was removed before we even had a chance to process it. 
                                                } catch (IOException ioe) {
                                                        LOGGER.error("Failed to read attribute for path " + child, ioe);
                                                }