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.transport.ftp.config;
8   
9   import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
10  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
11  import org.mule.endpoint.URIBuilder;
12  import org.mule.transport.file.ExpressionFilenameParser;
13  import org.mule.transport.file.FilenameParser;
14  import org.mule.transport.ftp.FtpConnector;
15  
16  /**
17   * Reigsters a Bean Definition Parser for handling <code><ftp:connector></code> elements.
18   */
19  public class FtpNamespaceHandler extends AbstractMuleNamespaceHandler
20  {
21      public void init()
22      {
23          registerStandardTransportEndpoints(FtpConnector.FTP, URIBuilder.SOCKET_ATTRIBUTES);
24          registerConnectorDefinitionParser(FtpConnector.class, FtpConnector.FTP);
25          
26          registerBeanDefinitionParser("custom-filename-parser", new ChildDefinitionParser("filenameParser", null, FilenameParser.class));
27          registerBeanDefinitionParser("expression-filename-parser", new ChildDefinitionParser("filenameParser", ExpressionFilenameParser.class));
28      }
29  }