Skip to content

Commit

Permalink
Refactor ImportMetaDataExecutor (#34502)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Jan 25, 2025
1 parent fccd997 commit 938852b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.io.IOException;
import java.nio.charset.Charset;
import java.sql.SQLException;
import java.util.Objects;

/**
* Import meta data executor.
Expand All @@ -48,7 +47,10 @@ public void executeUpdate(final ImportMetaDataStatement sqlStatement, final Cont
}

private String getMetaDataFromFile(final ImportMetaDataStatement sqlStatement) {
File file = new File(Objects.requireNonNull(sqlStatement.getFilePath()).get());
if (!sqlStatement.getFilePath().isPresent()) {
return "";
}
File file = new File(sqlStatement.getFilePath().get());
try {
return FileUtils.readFileToString(file, Charset.defaultCharset());
} catch (final IOException ignore) {
Expand Down

0 comments on commit 938852b

Please sign in to comment.