Skip to content

Commit

Permalink
Fix type and string match (#288)
Browse files Browse the repository at this point in the history
* Fix Typo and improved robust String Match

* fix

---------

Co-authored-by: Millard <hodin@microsoft.com>
  • Loading branch information
dinghong2233 and Millard committed Feb 21, 2023
1 parent 50ac620 commit c87d141
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

0 comments on commit c87d141

Please sign in to comment.