Browse Source

Be defensive if there is no main/classes

pull/408/merge
Dave Syer 12 years ago
parent
commit
6b5828a820
  1. 5
      spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java

5
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java

@ -95,8 +95,11 @@ public abstract class MainClassFinder { @@ -95,8 +95,11 @@ public abstract class MainClassFinder {
*/
public static <T> T doWithMainClasses(File rootFolder, ClassNameCallback<T> callback)
throws IOException {
if (!rootFolder.exists()) {
return null; // nothing to do
}
if (!rootFolder.isDirectory()) {
throw new IllegalArgumentException("Inavlid root folder '" + rootFolder + "'");
throw new IllegalArgumentException("Invalid root folder '" + rootFolder + "'");
}
String prefix = rootFolder.getAbsolutePath() + "/";
Deque<File> stack = new ArrayDeque<File>();

Loading…
Cancel
Save