格式化url,替换路径参数等。 @param shortUrl @return
(String shortUrl)
| 247 | * @return |
| 248 | */ |
| 249 | private String parseUrl(String shortUrl) { |
| 250 | // 替换url中的参数 |
| 251 | shortUrl = getCommonParam(shortUrl); |
| 252 | if (shortUrl.startsWith("http")) { |
| 253 | return shortUrl; |
| 254 | } |
| 255 | if (rooUrlEndWithSlash == shortUrl.startsWith("/")) { |
| 256 | if (rooUrlEndWithSlash) { |
| 257 | shortUrl = shortUrl.replaceFirst("/", ""); |
| 258 | } else { |
| 259 | shortUrl = "/" + shortUrl; |
| 260 | } |
| 261 | } |
| 262 | return rootUrl + shortUrl; |
| 263 | } |
| 264 | |
| 265 | } |
| 266 |
no test coverage detected