1 10 11 package org.mule.providers.dq; 12 13 import java.net.URI ; 14 import java.util.Properties ; 15 16 import org.mule.impl.endpoint.ResourceNameEndpointBuilder; 17 import org.mule.umo.endpoint.MalformedEndpointException; 18 19 22 public class DQEndpointBuilder extends ResourceNameEndpointBuilder 23 { 24 25 protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException 26 { 27 String lib = (String )props.get("lib"); 28 if (uri.getPath().length() > 0) 29 { 30 lib = uri.getHost(); 31 props.setProperty("lib", lib); 32 address = "/" + lib + uri.getPath(); 33 } 34 else if (lib == null) 35 { 36 throw new MalformedEndpointException("Could not extract Lib name: " + uri); 37 } 38 else 39 { 40 if (!lib.startsWith("/")) 41 { 42 lib = "/" + lib; 43 } 44 if (!lib.endsWith("/")) 45 { 46 lib += "/"; 47 } 48 address = lib + uri.getHost(); 49 } 50 51 } 59 } 60 | Popular Tags |