View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.cxf.employee;
8   
9   import org.apache.cxf.interceptor.Fault;
10  import org.apache.cxf.message.Message;
11  import org.apache.cxf.phase.AbstractPhaseInterceptor;
12  import org.apache.cxf.phase.Phase;
13  
14  public class AttachmentVerifyInterceptor extends AbstractPhaseInterceptor<Message>
15  {
16      public static boolean HasAttachments;
17      
18      public AttachmentVerifyInterceptor()
19      {
20          super(Phase.PRE_STREAM_ENDING);
21      }
22  
23      public void handleMessage(Message message) throws Fault
24      {
25          HasAttachments = message.getAttachments() != null && message.getAttachments().size() > 0;
26      }
27      
28  
29  }
30  
31