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

top.jfunc.common.propenv.DashStrategy Maven / Gradle / Ivy

The newest version!
package top.jfunc.common.propenv;

import top.jfunc.common.utils.FileUtil;
import top.jfunc.common.utils.StrUtil;

/**
 * ${fileName}-${env}.ext
 * @author xiongshiyan at 2021/2/7 , contact me with email [email protected] or phone 15208384257
 */
public class DashStrategy implements EnvFileNameStrategy{
    @Override
    public String generate(String srcFileName, String env) {
        if(StrUtil.isEmpty(env)){
            return srcFileName;
        }
        return FileUtil.getFileNameNoEx(srcFileName) + "-" + env +
                (srcFileName.contains(".") ? ("." + FileUtil.getExtensionName(srcFileName)) : "");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy