propertyutils 文件解读 -欧洲杯足彩官网

`
gaojingsong
  • 浏览: 1138400 次
  • 性别:
  • 来自: 深圳
博主相关
  • 博客
  • 微博
  • 相册
  • 收藏
  • 文章分类
    社区版块
    • ( 4)
    • ( 0)
    • ( 80)
    存档分类
    最新评论

    propertyutils 文件解读

    单例模式 ,静态代码块
    /**
     * property utils
     * single instance
     */
    public class propertyutils {
        /**
         * logger
         */
    private static final logger logger = loggerfactory.getlogger(propertyutils.class);
        private static final properties properties = new properties();
        private propertyutils() {
            throw new unsupportedoperationexception("construct propertyutils");
        }
        static {
            string[] propertyfiles = new string[]{"/common.properties"};
            for (string filename : propertyfiles) {
                inputstream fis = null;
                try {
                    fis = propertyutils.class.getresourceasstream(filename);
                    properties.load(fis);
                } catch (ioexception e) {
                    logger.error(e.getmessage(), e);
                    if (fis != null) {
                        ioutils.closequietly(fis);
                    }
                    system.exit(1);
                } finally {
                    ioutils.closequietly(fis);
                }
            }
        }
        /**
         *
         * @return  judge whether resource upload startup
         */
    public static boolean getresuploadstartupstate(){
            // hdfs 或者s3 资源是否启用
    string resuploadstartuptype = propertyutils.getuppercasestring("resource.storage.type");
            resuploadtype resuploadtype = resuploadtype.valueof(resuploadstartuptype);
            return resuploadtype == resuploadtype.hdfs || resuploadtype == resuploadtype.s3;
        }
       // 获取指定key或者获取不到赋予默认值省略
    }
    相关存储枚举如下:
    
    /**
     * data base types
     */
    public enum resuploadtype {
      /**
       * 0 hdfs
       * 1 s3
       * 2 none
       */
    hdfs,s3,none
    }
    代码来源于dolphinscheduler 的1.36版本
    
    分享到:
    评论

    相关推荐

      jar包,官方版本,自测可用

      jar包,官方版本,自测可用

      jar包,官方版本,自测可用

      null 博文链接:https://m635674608.iteye.com/blog/2270455

      easymock-propertyutils 注意:此库未维护,可能已被取代 这个库允许你在使用时对参数使用 javabeans 风格的属性匹配

      1:aes 加密解密 2:authutils 授权相关的工具类 3:base64 base64编码 ...23:propertyutils 属性工具类 24:querysqlutil 25:regexutils 26:testclass 28:uploadutils 文件上传工具 29:utiltest 30:videotool

      主要介绍了java反射获取class对象方式解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

      4.1 propertyutils,当属性为collection,map时的动态读取 4.2 propertyutils,获取属性的class类型 4.3 constructorutils,动态创建对象 4.4 methodutils,动态调用方法 4.5 动态bean 见用dynabean减除不必要的vo...

      1.1,beanutils propertyutils类副本与反射副本使用及效率比较。 1.2,收藏collectionutils从一个列表中查找符合一定条件的对象。 2,太阳 2.1,发送邮件javax.mail完成邮件的发送和接收。 3,mybatis 3.1,基本...

      beanutils.java cachedintrospectionresults.java classutils.java ...propertyutils.java reflectionutils.java resourceutils.java serializationutils.java stringutils.java typeutils.java validate.java

      1.propertyutils 对标注notnull注解的属性,检查其值是否为null 2.jsonutils 用于获取json字符串中指定key的value 示例 json = {"name":"刘禅","age":"6","father":{"name":"刘备","age":"50","properties": {...

      propertyutils property unility class randomutils random unility class resourceutils resource unility class sha1utils sha1 unility class serializableutils serializable unility class ...

    global site tag (gtag.js) - google analytics
    网站地图