Flink读取resource资源文件

 public static ParameterTool getParameterTool(String[] args){
        try {
            return ParameterTool
                    .fromPropertiesFile(PropertiesUtil.class.getResourceAsStream("FilePath"))
                    .mergeWith(ParameterTool.fromArgs(args))
                    .mergeWith(ParameterTool.fromSystemProperties());
        }catch (IOException e){
            log.error("读取配置文件错误",e);
        }
       return ParameterTool.fromSystemProperties();
    }
posted @ 2020-11-25 09:49  宁君  阅读(1863)  评论(0编辑  收藏  举报