Fix formatting issues

pull/79/head
Sasini Sandamali 2 years ago
parent 1864d659e1
commit aaec465dec

@ -28,7 +28,6 @@ import java.util.Set;
/** /**
* This bean class carries the properties used by some API that needs to be published within the underlying * This bean class carries the properties used by some API that needs to be published within the underlying
* API-Management infrastructure. * API-Management infrastructure.
* <p>
* A sample API configuration accepted by this particular bean class would look like what's shown below. * A sample API configuration accepted by this particular bean class would look like what's shown below.
* e.g. * e.g.
* *

@ -336,7 +336,8 @@ public class APIPublisherUtil {
String fullPaath = ""; String fullPaath = "";
if (!template.getUriTemplate().equals(AnnotationProcessor.WILD_CARD)) { if (!template.getUriTemplate().equals(AnnotationProcessor.WILD_CARD)) {
fullPaath = apiConfig.getContext() + template.getUriTemplate(); fullPaath = apiConfig.getContext() + template.getUriTemplate();
} else { }
else {
fullPaath = apiConfig.getContext(); fullPaath = apiConfig.getContext();
} }
for (String context : resourcesList) { for (String context : resourcesList) {

@ -52,7 +52,6 @@ import java.util.*;
public class AnnotationProcessor { public class AnnotationProcessor {
public static final String WILD_CARD = "/*";
private static final Log log = LogFactory.getLog(AnnotationProcessor.class); private static final Log log = LogFactory.getLog(AnnotationProcessor.class);
private static final String AUTH_TYPE = "Application & Application User"; private static final String AUTH_TYPE = "Application & Application User";
private static final String STRING_ARR = "string_arr"; private static final String STRING_ARR = "string_arr";
@ -60,6 +59,7 @@ public class AnnotationProcessor {
private static final String PACKAGE_ORG_APACHE = "org.apache"; private static final String PACKAGE_ORG_APACHE = "org.apache";
private static final String PACKAGE_ORG_CODEHAUS = "org.codehaus"; private static final String PACKAGE_ORG_CODEHAUS = "org.codehaus";
private static final String PACKAGE_ORG_SPRINGFRAMEWORK = "org.springframework"; private static final String PACKAGE_ORG_SPRINGFRAMEWORK = "org.springframework";
public static final String WILD_CARD = "/*";
private static final String SWAGGER_ANNOTATIONS_INFO = "info"; private static final String SWAGGER_ANNOTATIONS_INFO = "info";
private static final String SWAGGER_ANNOTATIONS_TAGS = "tags"; private static final String SWAGGER_ANNOTATIONS_TAGS = "tags";
private static final String SWAGGER_ANNOTATIONS_EXTENSIONS = "extensions"; private static final String SWAGGER_ANNOTATIONS_EXTENSIONS = "extensions";
@ -132,27 +132,6 @@ public class AnnotationProcessor {
log.error("An error has occurred while loading classes ", e); log.error("An error has occurred while loading classes ", e);
} }
} }
/**
* Find the URL pointing to "/WEB-INF/classes" This method may not work in conjunction with IteratorFactory
* if your servlet container does not extract the /WEB-INF/classes into a real file-based directory
*
* @param servletContext
* @return null if cannot determin /WEB-INF/classes
*/
private static URL findWebInfClassesPath(ServletContext servletContext) {
String path = servletContext.getRealPath("/WEB-INF/classes");
if (path == null) return null;
File fp = new File(path);
if (fp.exists() == false) return null;
try {
URI uri = fp.toURI();
return uri.toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
public Set<String> scanStandardContext(String className) throws IOException { public Set<String> scanStandardContext(String className) throws IOException {
ExtendedAnnotationDB db = new ExtendedAnnotationDB(); ExtendedAnnotationDB db = new ExtendedAnnotationDB();
db.addIgnoredPackages(PACKAGE_ORG_APACHE); db.addIgnoredPackages(PACKAGE_ORG_APACHE);
@ -511,6 +490,26 @@ public class AnnotationProcessor {
} }
} }
/**
* Find the URL pointing to "/WEB-INF/classes" This method may not work in conjunction with IteratorFactory
* if your servlet container does not extract the /WEB-INF/classes into a real file-based directory
*
* @param servletContext
* @return null if cannot determin /WEB-INF/classes
*/
private static URL findWebInfClassesPath(ServletContext servletContext) {
String path = servletContext.getRealPath("/WEB-INF/classes");
if (path == null) return null;
File fp = new File(path);
if (fp.exists() == false) return null;
try {
URI uri = fp.toURI();
return uri.toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
private APIResource getAPiOperationExtensions(Annotation currentMethod, APIResource apiResource) throws Throwable { private APIResource getAPiOperationExtensions(Annotation currentMethod, APIResource apiResource) throws Throwable {
InvocationHandler methodHandler = Proxy.getInvocationHandler(currentMethod); InvocationHandler methodHandler = Proxy.getInvocationHandler(currentMethod);
Annotation[] extensions = (Annotation[]) methodHandler.invoke(currentMethod, Annotation[] extensions = (Annotation[]) methodHandler.invoke(currentMethod,

Loading…
Cancel
Save