use of org.springframework.boot.autoconfigure.SpringBootApplication in project spring-cloud-function by spring-cloud.
the class AzureSpringFunctionInitializer method getStartClass.
private static Class<?> getStartClass(List<URL> list) {
for (URL url : list) {
try {
InputStream inputStream = url.openStream();
try {
Manifest manifest = new Manifest(inputStream);
String startClass = manifest.getMainAttributes().getValue("Main-Class");
if (startClass != null) {
Class<?> aClass = ClassUtils.forName(startClass, org.springframework.cloud.function.adapter.azure.AzureSpringFunctionInitializer.class.getClassLoader());
SpringBootApplication declaredAnnotation = aClass.getDeclaredAnnotation(SpringBootApplication.class);
if (declaredAnnotation != null) {
return aClass;
}
}
} finally {
inputStream.close();
}
} catch (Exception ex) {
}
}
return null;
}
Aggregations