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

com.aliyun.manager.config.ToolkitPackageConfigManager Maven / Gradle / Ivy

Go to download

Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

There is a newer version: 1.1.9
Show newest version
package com.aliyun.manager.config;

import com.aliyun.Context;
import com.aliyun.bean.config.ToolkitPackageConfig;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;

import java.io.File;

public class ToolkitPackageConfigManager extends AbstractConfigManager {

    private MavenProject project;
    private Log logger;

    public ToolkitPackageConfigManager() {
        super(false);
        this.project = Context.getProject();
        this.logger = Context.getLogger();
    }

    public ToolkitPackageConfig loadProperties(String configFile, String defaultFile) throws MojoExecutionException {

        try {
            if (configFile != null || new File(defaultFile).exists()) {
                return load(configFile, defaultFile, ToolkitPackageConfig.class);
            }
            throw new Exception("No toolkit package config is found.");
        } catch (Exception ex) {
            logger.error(ex);
            throw new MojoExecutionException(ex.getMessage());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy