public abstract class

PropertiesLoaderUtils

extends Object
java.lang.Object
   ↳ org.springframework.core.io.support.PropertiesLoaderUtils

Class Overview

Convenient utility methods for loading of java.util.Properties, performing standard handling of input streams.

For more configurable properties loading, including the option of a customized encoding, consider using the PropertiesLoaderSupport class.

Summary

Public Constructors
PropertiesLoaderUtils()
Public Methods
static void fillProperties(Properties props, Resource resource)
Fill the given properties from the given resource.
static Properties loadAllProperties(String resourceName, ClassLoader classLoader)
Load all properties from the given class path resource, using the given class loader.
static Properties loadAllProperties(String resourceName)
Load all properties from the given class path resource, using the default class loader.
static Properties loadProperties(Resource resource)
Load properties from the given resource.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PropertiesLoaderUtils ()

Also: SpringCore

Public Methods

public static void fillProperties (Properties props, Resource resource)

Also: SpringCore

Fill the given properties from the given resource.

Parameters
props the Properties instance to fill
resource the resource to load from
Throws
IOException if loading failed

public static Properties loadAllProperties (String resourceName, ClassLoader classLoader)

Also: SpringCore

Load all properties from the given class path resource, using the given class loader.

Merges properties if more than one resource of the same name found in the class path.

Parameters
resourceName the name of the class path resource
classLoader the ClassLoader to use for loading (or null to use the default class loader)
Returns
  • the populated Properties instance
Throws
IOException if loading failed

public static Properties loadAllProperties (String resourceName)

Also: SpringCore

Load all properties from the given class path resource, using the default class loader.

Merges properties if more than one resource of the same name found in the class path.

Parameters
resourceName the name of the class path resource
Returns
  • the populated Properties instance
Throws
IOException if loading failed

public static Properties loadProperties (Resource resource)

Also: SpringCore

Load properties from the given resource.

Parameters
resource the resource to load from
Returns
  • the populated Properties instance
Throws
IOException if loading failed