Fix from review: fix spelling
This commit is contained in:
parent
6bdb560e7c
commit
960696fb96
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user