INT-631 The imap-idle-channel-adapter's "store-uri" is now validated in the ImapMailReceiver constructor rather than during parsing. Therefore, it is now possible to use property placeholders.

This commit is contained in:
Mark Fisher
2009-06-17 16:01:44 +00:00
parent 8b4a0718bb
commit 1f6a909b92
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,6 +51,8 @@ public class ImapMailReceiver extends AbstractMailReceiver {
public ImapMailReceiver(String url) {
super(url);
Assert.isTrue(url.toLowerCase().startsWith("imap"),
"URL must start with 'imap' for the IMAP Mail receiver.");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,8 +61,6 @@ public class ImapIdleChannelAdapterParser extends AbstractSingleBeanDefinitionPa
private String parseImapMailReceiver(Element element, ParserContext parserContext) {
String uri = element.getAttribute("store-uri");
Assert.hasText(uri, "the 'store-uri' attribute is required");
Assert.isTrue(uri.toLowerCase().startsWith("imap"),
"store-uri must start with 'imap' for the imap idle channel adapter");
BeanDefinitionBuilder receiverBuilder = BeanDefinitionBuilder.genericBeanDefinition(ImapMailReceiver.class);
receiverBuilder.addConstructorArgValue(uri);
String propertiesRef = element.getAttribute("java-mail-properties");