Class PropertyUtils

java.lang.Object
io.quarkus.bootstrap.util.PropertyUtils

public class PropertyUtils extends Object
Author:
Alexey Loubyansky
  • Method Details

    • isWindows

      public static boolean isWindows()
    • getUserHome

      public static String getUserHome()
    • getProperty

      public static String getProperty(String name, String defValue)
    • getProperty

      public static String getProperty(String name)
    • getBooleanOrNull

      public static final Boolean getBooleanOrNull(String name)
    • getBoolean

      public static final boolean getBoolean(String name, boolean notFoundValue)
    • store

      public static void store(Properties properties, Path file, String leadingComment) throws IOException
      Stores properties into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      leadingComment - a leading comment, it will be prepended by an hash
      file - target file
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Properties properties, Writer writer, String leadingComment) throws IOException
      Stores properties into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      leadingComment - a leading comment, it will be prepended by an hash
      writer - target writer
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Map<String,String> properties, Path file, String leadingComment) throws IOException
      Stores a map of strings into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      file - target file
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Properties properties, Path file) throws IOException
      Stores properties into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      file - target file
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Properties properties, Writer writer) throws IOException
      Stores properties into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      writer - target writer
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Map<String,String> properties, Path file) throws IOException
      Stores a map of strings into a file sorting the keys alphabetically and following Properties.store(Writer, String) format but skipping the timestamp and comments.
      Parameters:
      properties - properties to store
      file - target file
      Throws:
      IOException - in case of a failure
    • store

      public static void store(Writer writer, String name, String value) throws IOException
      Writes a config option with its value to the target writer, possibly applying some transformations, such as character escaping prior to writing.
      Parameters:
      writer - target writer
      name - option name
      value - option value
      Throws:
      IOException - in case of a failure