程序包 cn.wjybxx.base

类 SystemPropsUtils

java.lang.Object
cn.wjybxx.base.SystemPropsUtils

public class SystemPropsUtils extends Object
系统属性工具类 除了系统属性外,我们不会再使用properties格式的配置文件,会选择json或dson. (我自身的项目一律会使用dson)
作者:
wjybxx date - 2024/1/5
  • 字段详细资料

    • WORKING_DIR

      public static final String WORKING_DIR
      工作目录
  • 构造器详细资料

    • SystemPropsUtils

      public SystemPropsUtils()
  • 方法详细资料

    • getString

      public static String getString(String key)
    • getString

      public static String getString(String key, String def)
    • getInt

      public static int getInt(String key)
    • getInt

      public static int getInt(String key, int def)
    • getLong

      public static long getLong(String key)
    • getLong

      public static long getLong(String key, long def)
    • getFloat

      public static float getFloat(String key)
    • getFloat

      public static float getFloat(String key, float def)
    • getDouble

      public static double getDouble(String key)
    • getDouble

      public static double getDouble(String key, double def)
    • getBool

      public static boolean getBool(String key)
    • getBool

      public static boolean getBool(String key, boolean def)
    • loadPropertiesFromFile

      public static Properties loadPropertiesFromFile(@Nonnull String path) throws IOException
      从普通文件中读取原始的配置
      抛出:
      IOException
    • loadPropertiesFromFile

      public static Properties loadPropertiesFromFile(@Nonnull File file) throws IOException
      抛出:
      IOException
    • loadPropertiesFromJar

      public static Properties loadPropertiesFromJar(String path) throws IOException
      从jar包读取配置原始的配置
      抛出:
      IOException
    • loadPropertiesFromJar

      public static Properties loadPropertiesFromJar(String path, ClassLoader classLoader) throws IOException
      抛出:
      IOException