Skip to content

Commit

Permalink
Prevent set to DB if no index file
Browse files Browse the repository at this point in the history
  • Loading branch information
nntthuy-axonivy committed Dec 24, 2024
1 parent 64e7871 commit 8a95ff7
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.*;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand Down Expand Up @@ -82,7 +74,8 @@ public String downloadAndUnzipFile(String url, boolean isForce) throws IOExcepti
private Path createTempFileFromUrlAndExtractToLocation(String url, String location,
boolean isForce) throws IOException {
File cacheFolder = new File(location);
if (cacheFolder.exists() && cacheFolder.isDirectory() && !isForce) {
if (cacheFolder.exists() && cacheFolder.isDirectory() && Objects.requireNonNull(
cacheFolder.listFiles()).length > 0 && !isForce) {
log.warn("Data is already in {}", location);
return null;
} else {
Expand Down

0 comments on commit 8a95ff7

Please sign in to comment.