Closes gh-11206
This commit is contained in:
Johnny Lim
2017-11-30 01:12:35 +09:00
committed by Phillip Webb
parent 7ebe4935ac
commit 44299bb980
7 changed files with 24 additions and 20 deletions

View File

@@ -42,13 +42,14 @@ public final class Layouts {
if (file == null) {
throw new IllegalArgumentException("File must not be null");
}
if (file.getName().toLowerCase().endsWith(".jar")) {
String lowerCaseFileName = file.getName().toLowerCase();
if (lowerCaseFileName.endsWith(".jar")) {
return new Jar();
}
if (file.getName().toLowerCase().endsWith(".war")) {
if (lowerCaseFileName.endsWith(".war")) {
return new War();
}
if (file.isDirectory() || file.getName().toLowerCase().endsWith(".zip")) {
if (file.isDirectory() || lowerCaseFileName.endsWith(".zip")) {
return new Expanded();
}
throw new IllegalStateException("Unable to deduce layout for '" + file + "'");