|
|
@ -37,6 +37,8 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager { |
|
|
|
|
|
|
|
|
|
|
|
private static final String PATH_SPLIT = "/"; |
|
|
|
private static final String PATH_SPLIT = "/"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String DEFAULT_CONTEXT_PATH = "/"; |
|
|
|
|
|
|
|
|
|
|
|
private Environment environment; |
|
|
|
private Environment environment; |
|
|
|
|
|
|
|
|
|
|
|
private ZookeeperTool zookeeperTool; |
|
|
|
private ZookeeperTool zookeeperTool; |
|
|
@ -146,14 +148,13 @@ public class ServiceZookeeperApiMetaManager implements ApiMetaManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { |
|
|
|
protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { |
|
|
|
|
|
|
|
String contextPath = environment.getProperty("server.servlet.context-path", DEFAULT_CONTEXT_PATH); |
|
|
|
String servletPath = apiMeta.getPath(); |
|
|
|
String servletPath = apiMeta.getPath(); |
|
|
|
if (servletPath == null) { |
|
|
|
if (servletPath == null) { |
|
|
|
servletPath = ""; |
|
|
|
servletPath = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!servletPath.startsWith(PATH_SPLIT)) { |
|
|
|
StringUtils.trimLeadingCharacter(servletPath, '/'); |
|
|
|
servletPath = PATH_SPLIT + servletPath; |
|
|
|
return contextPath + servletPath; |
|
|
|
} |
|
|
|
|
|
|
|
return servletPath; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|