From ef61d4f71306247071a83e722b902b299cbb3632 Mon Sep 17 00:00:00 2001 From: PotatoPeeler3000 Date: Fri, 26 Apr 2024 16:23:35 -0500 Subject: [PATCH] Fix logic in case a directory doesn't exist we don't through an exception, we just skip it --- .../us/ihmc/scs2/session/tools/RobotModelLoader.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scs2-session-logger/src/main/java/us/ihmc/scs2/session/tools/RobotModelLoader.java b/scs2-session-logger/src/main/java/us/ihmc/scs2/session/tools/RobotModelLoader.java index 25e19bc7e..2748d9485 100644 --- a/scs2-session-logger/src/main/java/us/ihmc/scs2/session/tools/RobotModelLoader.java +++ b/scs2-session-logger/src/main/java/us/ihmc/scs2/session/tools/RobotModelLoader.java @@ -234,14 +234,13 @@ private static ClassLoader unpackResources(String modelName, byte[] resourceZip) { while ((ze = zip.getNextEntry()) != null) { - Path target = resourceDirectory.resolve(ze.getName()); - Files.deleteIfExists(target); - + // No need to explicitly handle directories, they will be created when copying files. if (ze.isDirectory()) - { - Files.createDirectories(target); continue; - } + + Path target = resourceDirectory.resolve(ze.getName()); + + Files.deleteIfExists(target); if (!Files.exists(target.getParent())) Files.createDirectories(target.getParent());