Class PropertiesLoader

java.lang.Object
com.helger.io.rt.PropertiesLoader

@Immutable public final class PropertiesLoader extends Object
Helper class to ease the use of Properties class.
Author:
Philip Helger
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable com.helger.base.rt.NonBlockingProperties
    Load properties from the given readable resource using the default charset.
    static @Nullable com.helger.base.rt.NonBlockingProperties
    loadProperties(@NonNull IReadableResource aRes, @NonNull Charset aCharset)
    Load properties from the given readable resource using the specified charset.
    static @Nullable com.helger.base.rt.NonBlockingProperties
    loadProperties(@NonNull File aFile)
    Load properties from the given file using the default charset.
    static @Nullable com.helger.base.rt.NonBlockingProperties
    loadProperties(@NonNull File aFile, @NonNull Charset aCharset)
    Load properties from the given file using the specified charset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • loadProperties

      public static @Nullable com.helger.base.rt.NonBlockingProperties loadProperties(@NonNull File aFile)
      Load properties from the given file using the default charset.
      Parameters:
      aFile - The file to load from. May not be null.
      Returns:
      null if the file could not be loaded.
    • loadProperties

      public static @Nullable com.helger.base.rt.NonBlockingProperties loadProperties(@NonNull File aFile, @NonNull Charset aCharset)
      Load properties from the given file using the specified charset.
      Parameters:
      aFile - The file to load from. May not be null.
      aCharset - The charset to use. May not be null.
      Returns:
      null if the file could not be loaded.
    • loadProperties

      public static @Nullable com.helger.base.rt.NonBlockingProperties loadProperties(@NonNull IReadableResource aRes)
      Load properties from the given readable resource using the default charset.
      Parameters:
      aRes - The resource to load from. May not be null.
      Returns:
      null if the resource could not be loaded.
    • loadProperties

      public static @Nullable com.helger.base.rt.NonBlockingProperties loadProperties(@NonNull IReadableResource aRes, @NonNull Charset aCharset)
      Load properties from the given readable resource using the specified charset.
      Parameters:
      aRes - The resource to load from. May not be null.
      aCharset - The charset to use. May not be null.
      Returns:
      null if the resource could not be loaded.