fix get dockerfile catch
@@ -43,6 +43,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ResourceUtils;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.InputStream;
import java.nio.file.Files;
import java.time.Duration;
@@ -161,11 +162,17 @@ public class DockerUtil {
public static File getResourceToFile(String name, File tempDir) {
try {
for (String filePath : FILE_PATHS) {
- File file = ResourceUtils.getFile(filePath + name);
+ File file;
+ try {
+ file = ResourceUtils.getFile(filePath + name);
if (!file.exists()) {
log.debug("{} not found", filePath + name);
continue;
}
+ } catch (FileNotFoundException e) {
+ log.debug("{} not found", filePath + name);
+ continue;
+ }
log.debug("found file:{}", file.getAbsolutePath());
File tempFile = DockerUtil.createTemp(name, tempDir);
Files.copy(file.toPath(), tempFile.toPath());
