package io.renren.config;

import io.renren.common.utils.FTPUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Slf4j
public class FTPConfig {
    @Value("${host}")
    private String host;
    @Value("${host-username}")
    private String username;
    @Value("${host-password}")
    private String password;
    @Value("${host-basepath}")
    private String basePath;
    @Value("${host-port}")
    private int port;
    @Value("${key-needed}")
    private boolean key_needed;
    @Value("${key-location}")
    private String key_location;

    @Bean
    public FTPUtils createFTPUtil(){
        return new FTPUtils(host,username,password,basePath,port,key_needed,key_location);
    }

}
