All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.consol.citrus.ftp.config.xml.FtpServerParser Maven / Gradle / Ivy

There is a newer version: 3.4.1
Show newest version
/*
 * Copyright 2006-2014 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 com.consol.citrus.ftp.config.xml;

import com.consol.citrus.config.util.BeanDefinitionParserUtils;
import com.consol.citrus.config.xml.AbstractServerParser;
import com.consol.citrus.ftp.server.FtpServer;
import com.consol.citrus.server.AbstractServer;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

/**
 * @author Christoph Deppisch
 * @since 2.0
 */
public class FtpServerParser extends AbstractServerParser {

    @Override
    protected void parseServer(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) {
        BeanDefinitionParserUtils.setPropertyValue(builder, element.getAttribute("port"), "port");

        BeanDefinitionParserUtils.setPropertyReference(builder, element.getAttribute("server"), "ftpServer");
        BeanDefinitionParserUtils.setPropertyReference(builder, element.getAttribute("user-manager"), "userManager");
        BeanDefinitionParserUtils.setPropertyValue(builder, element.getAttribute("user-manager-properties"), "userManagerProperties");
    }

    @Override
    protected Class getServerClass() {
        return FtpServer.class;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy