Skip to content

Commit

Permalink
When list of files (csv or similar) cannot be listed due to security …
Browse files Browse the repository at this point in the history
…issues, just return an empty list.
  • Loading branch information
piotrczarnas committed Dec 27, 2024
1 parent b56331d commit 27986c6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
Expand All @@ -34,7 +35,7 @@ public List<SourceTableModel> listTables(DuckdbParametersSpec duckdb, String sch
String pathPrefixString = duckdb.getDirectories().get(schemaName);
File[] files = Path.of(pathPrefixString).toFile().listFiles();
if(files == null){
return null;
return new ArrayList<>();
}
String folderPrefix = StringUtils.removeEnd(StringUtils.removeEnd(pathPrefixString, "/"), "\\");

Expand Down

0 comments on commit 27986c6

Please sign in to comment.