You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/04/13 10:18:09 UTC
[cxf] 02/02: CXF-7703 - Make SwaggerUiResourceLocator a public class
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit c0ccbe898706ee3dc28f989ca804445baca4bccb
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Apr 13 10:27:19 2018 +0100
CXF-7703 - Make SwaggerUiResourceLocator a public class
---
.../cxf/jaxrs/swagger/SwaggerUiResourceLocator.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUiResourceLocator.java b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUiResourceLocator.java
index 7b2f081..05a41c2 100644
--- a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUiResourceLocator.java
+++ b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUiResourceLocator.java
@@ -29,10 +29,10 @@ import org.apache.cxf.common.util.StringUtils;
/**
* Swagger UI resource locator
*/
-class SwaggerUiResourceLocator {
+public class SwaggerUiResourceLocator {
private final String swaggerUiRoot;
-
- SwaggerUiResourceLocator(String swaggerUiRoot) {
+
+ public SwaggerUiResourceLocator(String swaggerUiRoot) {
this.swaggerUiRoot = swaggerUiRoot;
}
@@ -42,26 +42,26 @@ class SwaggerUiResourceLocator {
* @return Swagger UI resource URL
* @throws MalformedURLException
*/
- URL locate(String resourcePath) throws MalformedURLException {
+ public URL locate(String resourcePath) throws MalformedURLException {
if (StringUtils.isEmpty(resourcePath) || "/".equals(resourcePath)) {
resourcePath = "index.html";
}
-
+
if (resourcePath.startsWith("/")) {
resourcePath = resourcePath.substring(1);
}
-
+
return URI.create(swaggerUiRoot + resourcePath).toURL();
}
-
+
/**
* Checks the existence of the Swagger UI resource corresponding to resource path
* @param resourcePath resource path
* @return "true" if Swagger UI resource exists, "false" otherwise
*/
- boolean exists(String resourcePath) {
+ public boolean exists(String resourcePath) {
try {
- // The connect() will try to locate the entry (jar file, classpath resource)
+ // The connect() will try to locate the entry (jar file, classpath resource)
// and fail with FileNotFoundException /IOException if there is none.
locate(resourcePath).openConnection().connect();
return true;
--
To stop receiving notification emails like this one, please contact
coheigea@apache.org.