protected void validateUriTemplate(String uri) throws MalformedEndpointException { if (uri.indexOf(":") > uri.indexOf(ExpressionManager.DEFAULT_EXPRESSION_PREFIX)) { throw new MalformedEndpointException(CoreMessages.dynamicEndpointsMustSpecifyAScheme(), uri); } }
private void validateTemplate(String address) throws MalformedEndpointException { if (address.indexOf(":") > address.indexOf(ExpressionManager.DEFAULT_EXPRESSION_PREFIX)) { throw new MalformedEndpointException(CoreMessages.dynamicEndpointsMustSpecifyAScheme(), address); } }
private void checkRecipient(URI uri) throws MalformedEndpointException { if (isDynamic(uri)) { return; } // the recipient is stored in the path of the URL if (uri.getPath().length() == 0) { throw new MalformedEndpointException(XmppMessages.noRecipientInUri(), uri.toString()); } }
protected String preprocessUri(String uriString) throws MalformedEndpointException { uriString = uriString.trim().replaceAll(" ", "%20"); if (!validateUrl(uriString)) { throw new MalformedEndpointException(uriString); } schemeMetaInfo = retrieveSchemeMetaInfo(uriString); if (schemeMetaInfo != null) { uriString = uriString.replaceFirst(schemeMetaInfo + ":", ""); } return uriString; }
private void checkXmppMessageType(URI uri) throws MalformedEndpointException { // the XMPP message type is stored in the host of the URL String host = uri.getHost(); if (host.length() == 0) { throw new MalformedEndpointException(XmppMessages.noMessageTypeInUri(), uri.toString()); } try { XmppMessageType.valueOf(host); } catch (IllegalArgumentException e) { throw new MalformedEndpointException(XmppMessages.invalidMessageTypeInUri(), uri.toString()); } }
private String decode(String string, URI uri, MuleContext context) throws MalformedEndpointException { try { String encoding = "UTF-8"; if(context!=null) { encoding = context.getConfiguration().getDefaultEncoding(); } return URLDecoder.decode(string, encoding); } catch (UnsupportedEncodingException e) { throw new MalformedEndpointException(uri.toString(), e); } } }
throw new MalformedEndpointException(uri.toString());
@Override protected void validateUriTemplate(String uri) throws MalformedEndpointException { if (uri.indexOf(parser.getStyle().getPrefix()) > -1 && uri.indexOf(":") > uri.indexOf(parser.getStyle().getPrefix())) { throw new MalformedEndpointException(CoreMessages.dynamicEndpointsMustSpecifyAScheme(), uri); } }
/** * Creates but does not initialize the endpoint URI. It is up to the caller * to call initialise() at some point. */ public MuleEndpointURI(String uri, String encodedUri, MuleContext muleContext) throws EndpointException { this.muleContext = muleContext; uri = preprocessUri(uri); String startUri = uri; uri = convertExpressionDelimiters(uri, "#"); uri = convertExpressionDelimiters(uri, "$"); if (uri.indexOf("#[") >= 0) { address = uri; dynamic = true; } else { try { this.uri = new URI((encodedUri != null && uri.equals(startUri)) ? preprocessUri(encodedUri) : uri); } catch (URISyntaxException e) { throw new MalformedEndpointException(uri, e); } this.userInfo = this.uri.getUserInfo(); } }
if(muleContext.getExpressionManager().isExpression(uri)) throw new MalformedEndpointException(CoreMessages.dynamicEndpointURIsCannotBeUsedOnInbound(), uri);
throw new MalformedEndpointException(uri);