diff --git a/agent/src/main/java/com/microsoft/hydralab/agent/util/FileLoadUtil.java b/agent/src/main/java/com/microsoft/hydralab/agent/util/FileLoadUtil.java index 9b9f00f94..8354fc38c 100644 --- a/agent/src/main/java/com/microsoft/hydralab/agent/util/FileLoadUtil.java +++ b/agent/src/main/java/com/microsoft/hydralab/agent/util/FileLoadUtil.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; +import java.util.Locale; import java.util.concurrent.TimeUnit; @Service @@ -104,14 +105,13 @@ public void loadCommonFile(BlobFileInfo attachment) { Assert.isTrue(!loadFolder.exists(), "Load file error : folder has been existed!"); log.info("Load common file start filename:{} path:{}", attachment.getFileName(), loadFolder.getAbsolutePath()); File attachmentFile = downloadFromBlob(attachment, appOptions.getLocation(), attachment.getLoadDir() + "/" + attachment.getFileName()); - if (BlobFileInfo.LoadType.UNZIP.equals(attachment.getLoadType())) { + if (BlobFileInfo.LoadType.UNZIP.equalsIgnoreCase(attachment.getLoadType())) { FileUtil.unzipFile(attachmentFile.getAbsolutePath(), loadFolder.getAbsolutePath()); } log.info("Load common file success"); } catch (Exception e) { log.error("Load common file start failed", e); } - } private File downloadFromBlob(BlobFileInfo attachment, String location, String targetFilePath) throws IOException { diff --git a/gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/BlobFileInfo.java b/gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/BlobFileInfo.java index b844a7ae0..7d4206f85 100644 --- a/gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/BlobFileInfo.java +++ b/gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/BlobFileInfo.java @@ -22,14 +22,14 @@ public class BlobFileInfo { public interface fileType { String WINDOWS_APP = "WINAPP"; - String COMMOM_FILE = "COMMON"; + String COMMON_FILE = "COMMON"; String AGENT_PACKAGE = "PACKAGE"; String APP_FILE = "APP"; String TEST_APP_FILE = "TEST_APP"; } public interface loadType { - String CPOY = "COPY"; + String COPY = "COPY"; String UNZIP = "UNZIP"; } } \ No newline at end of file