Skip to content

Commit

Permalink
Fix loading log resources (#177)
Browse files Browse the repository at this point in the history
Fix logic in case a directory doesn't exist we don't through an
exception, we just skip it
  • Loading branch information
PotatoPeeler3000 authored Jun 5, 2024
1 parent eb127cb commit 5ed12cc
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5ed12cc

Please sign in to comment.