diff --git a/src/main/java/com/epam/jira/util/JiraInfoProvider.java b/src/main/java/com/epam/jira/util/JiraInfoProvider.java index fce436d..282765b 100644 --- a/src/main/java/com/epam/jira/util/JiraInfoProvider.java +++ b/src/main/java/com/epam/jira/util/JiraInfoProvider.java @@ -46,7 +46,7 @@ public static void saveFile(File file) { // Get relative file path if file placed in target directory or copy it there try { String filePath = file.getCanonicalPath(); - boolean placedOutOfTargetDir = !filePath.startsWith(currentDir + FileUtils.getTargetDir()); + boolean placedOutOfTargetDir = !file.getCanonicalFile().toPath().startsWith(currentDir + FileUtils.getTargetDir()); targetFilePath = placedOutOfTargetDir ? FileUtils.saveFile(file, file.getName()) : filePath.replaceFirst(currentDir, "");