diff --git a/src/main/java/org/whitesource/agent/utils/FilesScanner.java b/src/main/java/org/whitesource/agent/utils/FilesScanner.java index b4b6f1b..29b4c18 100644 --- a/src/main/java/org/whitesource/agent/utils/FilesScanner.java +++ b/src/main/java/org/whitesource/agent/utils/FilesScanner.java @@ -126,7 +126,7 @@ private Map> getTopFoldersWithIncludedFiles(String rootFolde Path folderPath = Paths.get(folder); boolean shouldRemove = false; try { - shouldRemove = otherFolderPath.toFile().getCanonicalPath().startsWith(folderPath.toFile().getCanonicalPath()); + shouldRemove = otherFolderPath.toFile().getCanonicalFile().toPath().startsWith(folderPath.toFile().getCanonicalFile().toPath()); } catch (Exception e) { logger.debug("could not get file path " + otherFolderPath + folderPath, e.getStackTrace()); logger.warn("could not get file path " + otherFolderPath + folderPath, e.getMessage()); @@ -152,4 +152,4 @@ public boolean isIncluded(File file, String[] includes, String[] excludes, boole scanner.setCaseSensitive(globCaseSensitive); return scanner.isIncluded(file); } -} \ No newline at end of file +}