From 9f0e5be785b58c4a5ced6ff5c7ad9159f963a10e Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 10 Nov 2015 21:16:41 -0800 Subject: [PATCH] Ignore failed copies. --- .../main/java/com/beust/kobalt/wrapper/Main.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index 6a0b2f8c..fcd484ff 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -3,10 +3,7 @@ package com.beust.kobalt.wrapper; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; +import java.nio.file.*; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; @@ -138,8 +135,12 @@ public class Main { } else { Path dest = Paths.get(zipOutputDir, entryFile.getPath()); log(2, " Writing " + entry.getName() + " to " + dest); - Files.createDirectories(dest.getParent()); - Files.copy(zipFile.getInputStream(entry), dest, StandardCopyOption.REPLACE_EXISTING); + try { + Files.createDirectories(dest.getParent()); + Files.copy(zipFile.getInputStream(entry), dest, StandardCopyOption.REPLACE_EXISTING); + } catch(FileSystemException ex) { + log(2, "Couldn't copy to " + dest + ", skipping it"); + } } } success = true;