You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "machi1990 (via GitHub)" <gi...@apache.org> on 2023/05/19 12:51:41 UTC
[GitHub] [kafka] machi1990 commented on a diff in pull request #13733: KAFKA-13337: fix of possible java.nio.file.AccessDeniedException during Connect plugin directory scan
machi1990 commented on code in PR #13733:
URL: https://github.com/apache/kafka/pull/13733#discussion_r1198923768
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java:
##########
@@ -142,8 +142,12 @@ public class PluginUtils {
+ "|common\\.config\\.provider\\.(?!ConfigProvider$).*"
+ ")$");
- private static final DirectoryStream.Filter<Path> PLUGIN_PATH_FILTER = path ->
- Files.isDirectory(path) || isArchive(path) || isClassFile(path);
+ private static final DirectoryStream.Filter<Path> PLUGIN_PATH_FILTER = path -> {
+ if (!Files.isReadable(path)) {
+ log.warn("Non readable plugin path found, skipping: '{}'", path);
+ }
+ return Files.isReadable(path) && (Files.isDirectory(path) || isArchive(path) || isClassFile(path));
Review Comment:
```suggestion
boolean isReadable = Files.isReadable(path);
if (!isReadable) {
log.warn("Non readable plugin path found, skipping: '{}'", path);
}
return isReadable && (Files.isDirectory(path) || isArchive(path) || isClassFile(path));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org