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