diff --git a/transformer-cloudnet3/src/main/java/com/github/derrop/cloudnettransformer/cloudnet3/CloudNet3Utils.java b/transformer-cloudnet3/src/main/java/com/github/derrop/cloudnettransformer/cloudnet3/CloudNet3Utils.java index 0d55004..d36fa62 100644 --- a/transformer-cloudnet3/src/main/java/com/github/derrop/cloudnettransformer/cloudnet3/CloudNet3Utils.java +++ b/transformer-cloudnet3/src/main/java/com/github/derrop/cloudnettransformer/cloudnet3/CloudNet3Utils.java @@ -51,6 +51,10 @@ public static ServiceInclusion documentToInclusion(Document document) { } public static Path resolveApplicationPath(ServiceEnvironment environment, Path directory) throws IOException { + if (Files.notExists(directory)) { + return null; + } + String[] contents = APPLICATION_FILE_CONTENTS.get(environment); if (contents == null) { return null; diff --git a/transformer-core/src/main/java/com/github/derrop/cloudnettransformer/util/HttpHelper.java b/transformer-core/src/main/java/com/github/derrop/cloudnettransformer/util/HttpHelper.java index c9f6e75..2719a70 100644 --- a/transformer-core/src/main/java/com/github/derrop/cloudnettransformer/util/HttpHelper.java +++ b/transformer-core/src/main/java/com/github/derrop/cloudnettransformer/util/HttpHelper.java @@ -22,6 +22,7 @@ public static boolean download(String url, Path path) throws IOException { public static boolean download(String url, OutputStream outputStream) throws IOException { HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); + connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"); connection.connect(); if (connection.getResponseCode() != 200) {