Fix from review: fix spelling

This commit is contained in:
Quentin Jaquier 2025-03-28 11:33:19 +01:00
parent 6bdb560e7c
commit 960696fb96
2 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ public class ExampleController
File file = new File(targetDirectory + filename);
if (!file.exists()) { // Noncompliant
throw new IOException("File does not exists in the target directory");
throw new IOException("File does not exist in the target directory");
}
}
}
@ -46,7 +46,7 @@ public class ExampleController
if (!canonicalDestinationPath.startsWith(targetDirectory)) {
throw new IOException("Entry is outside of the target directory");
} else if (!file.exists()) {
throw new IOException("File does not exists in the target directory");
throw new IOException("File does not exist in the target directory");
}
}
}

View File

@ -18,7 +18,7 @@ class ExampleController {
val file = File(TARGET_DIRECTORY + filename)
if (!file.exists()) { // Noncompliant
throw IOException("File does not exists in the target directory")
throw IOException("File does not exist in the target directory")
}
}
}
@ -37,12 +37,12 @@ class ExampleController {
fun exists(@RequestParam("filename") filename: String) {
val file = File(TARGET_DIRECTORY + filename)
val canonicalDestinationPath: String = file.getCanonicalPath()
val canonicalDestinationPath = file.getCanonicalPath()
if (!canonicalDestinationPath.startsWith(TARGET_DIRECTORY)) {
throw IOException("Entry is outside of the target directory")
} else if (!file.exists()) {
throw IOException("File does not exists in the target directory")
throw IOException("File does not exist in the target directory")
}
}
}