Class PropertyUtils


  • public class PropertyUtils
    extends java.lang.Object
    • Constructor Detail

      • PropertyUtils

        public PropertyUtils()
        The constructor.
    • Method Detail

      • loadProperties

        @Deprecated
        public static java.util.Properties loadProperties​(@Nonnull
                                                          java.net.URL url)
        Deprecated.
        As of 3.1.0, please use method loadOptionalProperties(java.net.URL). This method should not be used as it suppresses exceptions silently when loading properties fails and returns null instead of an empty Properties instance when the given URL is null.
        Parameters:
        url - The URL which should be used to load the properties.
        Returns:
        The loaded properties.
      • loadProperties

        @Deprecated
        public static java.util.Properties loadProperties​(@Nonnull
                                                          java.io.File file)
        Deprecated.
        As of 3.1.0, please use method loadOptionalProperties(java.io.File). This method should not be used as it suppresses exceptions silently when loading properties fails and returns null instead of an empty Properties instance when the given File is null.
        Parameters:
        file - The file from which the properties will be loaded.
        Returns:
        The loaded properties.
      • loadProperties

        @Deprecated
        public static java.util.Properties loadProperties​(@Nullable
                                                          java.io.InputStream is)
        Deprecated.
        As of 3.1.0, please use method loadOptionalProperties(java.io.InputStream). This method should not be used as it suppresses exceptions silently when loading properties fails.
        Parameters:
        is - InputStream
        Returns:
        The loaded properties.
      • loadOptionalProperties

        @Nonnull
        public static java.util.Properties loadOptionalProperties​(@Nullable
                                                                  java.net.URL url)
        Loads Properties from a given URL.

        If the given URL is not null, it is asserted to represent a valid and loadable properties resource.

        Parameters:
        url - The URL of the properties resource to load or null.
        Returns:
        The loaded properties or an empty Properties instance if url is null.
        Since:
        3.1.0
      • loadOptionalProperties

        @Nonnull
        public static java.util.Properties loadOptionalProperties​(@Nullable
                                                                  java.io.File file)
        Loads Properties from a given File.

        If the given File is not null, it is asserted to represent a valid and loadable properties resource.

        Parameters:
        file - The File of the properties resource to load or null.
        Returns:
        The loaded properties or an empty Properties instance if file is null.
        Since:
        3.1.0
      • loadOptionalProperties

        @Nonnull
        public static java.util.Properties loadOptionalProperties​(@Nullable
                                                                  java.io.InputStream inputStream)
        Loads Properties from a given InputStream.

        If the given InputStream is not null, it is asserted to represent a valid and loadable properties resource.

        Parameters:
        inputStream - The InputStream of the properties resource to load or null.
        Returns:
        The loaded properties or an empty Properties instance if inputStream is null.
        Since:
        3.1.0