Skip to content

Commit

Permalink
Update TestLoadAdapter.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ghareeb-falazi committed Sep 7, 2024
1 parent ebbc602 commit ee5bc8e
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,20 @@ public void testLoadConnectionProfile() throws IOException, URISyntaxException {
private void clearPluginDirectory() throws IOException {
log.info("Cleaning up plugin directory from potential plugin files: {}", () -> pluginManager.getPluginsPath());
Path path = pluginManager.getPluginsPath();
try(Stream<Path> files = Files.list(path)) {
files.forEach(filePath -> {
try {
if (Files.isRegularFile(filePath)) {
log.info("Removing file: {}", filePath);
Files.delete(filePath);

if (Files.exists(path)) {
try (Stream<Path> files = Files.list(path)) {
files.forEach(filePath -> {
try {
if (Files.isRegularFile(filePath)) {
log.info("Removing file: {}", filePath);
Files.delete(filePath);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
});
});
}
}
}

Expand Down

0 comments on commit ee5bc8e

Please sign in to comment.