Skip to content

Commit

Permalink
Merge pull request spring-projects#70 from ghillert/INTSAMPLES-98
Browse files Browse the repository at this point in the history
INTSAMPLES-98 - Fix Typos in Mail and Multipart Sample
  • Loading branch information
ghillert committed Nov 30, 2012
2 parents 4b69b31 + 848de67 commit 074383c
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/**
*
/*
* Copyright 2002-2012 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.mail.imapidle;

Expand All @@ -18,7 +30,7 @@
public class GmailInboundImapIdleAdapterTestApp {
private static Logger logger = Logger.getLogger(GmailInboundImapIdleAdapterTestApp.class);


public static void main (String[] args) throws Exception {
ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-imap-idle-config.xml");
DirectChannel inputChannel = ac.getBean("recieveChannel", DirectChannel.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/**
*
/*
* Copyright 2002-2012 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.mail.imapidle;

Expand All @@ -18,10 +30,10 @@
public class GmailInboundPop3AdapterTestApp {

private static Logger logger = Logger.getLogger(GmailInboundPop3AdapterTestApp.class);

public static void main (String[] args) throws Exception {
ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-pop3-config.xml");
DirectChannel inputChannel = ac.getBean("recieveChannel", DirectChannel.class);
DirectChannel inputChannel = ac.getBean("receiveChannel", DirectChannel.class);
inputChannel.subscribe(new MessageHandler() {
public void handleMessage(Message<?> message) throws MessagingException {
logger.info("Message: " + message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:util="http://www.springframework.org/schema/util">

<int:channel id="recieveChannel" />
<int:channel id="receiveChannel" />
<!-- replace 'userid and 'password' wit the real values -->
<int-mail:imap-idle-channel-adapter id="customAdapter"
store-uri="imaps://[userid]:[pasword]@imap.gmail.com:993/inbox"
channel="recieveChannel"
channel="receiveChannel"
auto-startup="true"
should-delete-messages="false"
should-mark-messages-as-read="false"
java-mail-properties="javaMailProperties"/>

<util:properties id="javaMailProperties">
<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.imap.socketFactory.fallback">false</prop>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:util="http://www.springframework.org/schema/util">

<int:channel id="recieveChannel" />
<int:channel id="receiveChannel" />
<!-- replace 'userid and 'password' wit the real values -->
<int-mail:inbound-channel-adapter id="pop3ShouldDeleteTrue"
store-uri="pop3://[userid]:[password]@pop.gmail.com/INBOX"
channel="recieveChannel"
should-delete-messages="true"
auto-startup="true"
<int-mail:inbound-channel-adapter id="pop3ShouldDeleteTrue"
store-uri="pop3://[userid]:[password]@pop.gmail.com/INBOX"
channel="receiveChannel"
should-delete-messages="true"
auto-startup="true"
java-mail-properties="javaMailProperties">
<!-- Will poll every 20 seconds -->
<!-- Will poll every 20 seconds -->
<int:poller fixed-rate="20000"/>

</int-mail:inbound-channel-adapter>

<util:properties id="javaMailProperties">
Expand Down
8 changes: 4 additions & 4 deletions intermediate/multipart-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ The Server is Spring Integration's HTTP endpoint configuration.

To run this sample:

1. Deploy project
1. Deploy project
* If you are using STS and project is imported as Eclipse project in your workspace you can just execute **Run on Server**
* You can also run **mvn clean install** and generate the WAR file that you can deploy the conventional way
2. run the simple test client program: **org.springframework.integration.samples.multipart.MultipartClient**

You should see the following output from the server:
INFO : ...MultipartClient - Successfully recieved multipart request: {company=[[Ljava.lang.String;@147e8bd9], company-logo=[org.springframework.integration.http.UploadedMultipartFile@f5e12]}

INFO : ...MultipartClient - Successfully received multipart request: {company=[[Ljava.lang.String;@147e8bd9], company-logo=[org.springframework.integration.http.UploadedMultipartFile@f5e12]}
INFO : ...MultipartClient - company - SpringSource
INFO : org.springframework.integration.samples.multipart.MultipartClient - company-logo - as UploadedMultipartFile: spring09_logo.png
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
Expand All @@ -24,12 +24,12 @@
* @author Oleg Zhurakousky
*
*/
public class MultipartReceiever {
private static Logger logger = Logger.getLogger(MultipartReceiever.class);
public class MultipartReceiver {
private static Logger logger = Logger.getLogger(MultipartReceiver.class);

@SuppressWarnings("rawtypes")
public void recieve(LinkedMultiValueMap<String, Object> multipartRequest){
logger.info("Successfully recieved multipart request: " + multipartRequest);
public void receive(LinkedMultiValueMap<String, Object> multipartRequest){
logger.info("Successfully received multipart request: " + multipartRequest);
for (String elementName : multipartRequest.keySet()) {
if (elementName.equals("company")){
LinkedList value = (LinkedList)multipartRequest.get("company");
Expand All @@ -38,7 +38,7 @@ public void recieve(LinkedMultiValueMap<String, Object> multipartRequest){
logger.info(elementName + " - " + companyName);
}
} else if (elementName.equals("company-logo")){
logger.info(elementName + " - as UploadedMultipartFile: "
logger.info(elementName + " - as UploadedMultipartFile: "
+ ((UploadedMultipartFile) multipartRequest.getFirst("company-logo")).getOriginalFilename());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<int:channel id="receiveChannel"/>

<int:service-activator id="multipartReceiver" input-channel="receiveChannel">
<bean class="org.springframework.integration.samples.multipart.MultipartReceiever"/>
<bean class="org.springframework.integration.samples.multipart.MultipartReceiver"/>
</int:service-activator>

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
Expand Down

0 comments on commit 074383c

Please sign in to comment.