1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.endpoint; |
8 | |
|
9 | |
import org.mule.api.endpoint.MalformedEndpointException; |
10 | |
import org.mule.util.StringUtils; |
11 | |
|
12 | |
import java.net.URI; |
13 | |
import java.util.Properties; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | 0 | public class UrlEndpointURIBuilder extends AbstractEndpointURIBuilder |
20 | |
{ |
21 | |
@Override |
22 | |
protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException |
23 | |
{ |
24 | 0 | address = ""; |
25 | 0 | if (uri.getHost() != null) |
26 | |
{ |
27 | |
|
28 | 0 | this.address = uri.getScheme() + "://" + uri.getHost(); |
29 | 0 | if (uri.getPort() != -1) |
30 | |
{ |
31 | 0 | address += ":" + uri.getPort(); |
32 | |
} |
33 | |
} |
34 | 0 | if (StringUtils.isNotBlank(uri.getRawPath())) |
35 | |
{ |
36 | 0 | address += uri.getRawPath(); |
37 | |
} |
38 | |
|
39 | 0 | if (StringUtils.isNotBlank(uri.getRawQuery())) |
40 | |
{ |
41 | 0 | address += "?" + uri.getRawQuery(); |
42 | |
} |
43 | 0 | } |
44 | |
} |