T
- Properties
or a subclass like SortedProperties
.public abstract class AbstractPropertiesFactory<T extends Properties> extends Object
Properties
Modifier | Constructor and Description |
---|---|
protected |
AbstractPropertiesFactory()
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createProperties()
Subclasses override to provide customized properties instances.
|
T |
load(ClassLoader classLoader,
String name)
Creates and loads properties from the given file.
|
T |
load(File file)
Creates and loads properties from the given file.
|
T |
load(InputStream inputStream)
Creates and loads properties from the given input stream.
|
T |
load(Path path)
Creates and loads properties from the given path.
|
T |
load(Reader reader)
Creates and loads properties from the given reader.
|
T |
load(String name)
Creates and loads properties from the given file name.
|
T |
load(URI uri)
Creates and loads properties from the given URI.
|
T |
load(URL url)
Creates and loads properties from the given URL.
|
protected AbstractPropertiesFactory()
protected abstract T createProperties()
public T load(ClassLoader classLoader, String name) throws IOException
classLoader
- the class loader to use to get the named resource.name
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(File file) throws FileNotFoundException, IOException
file
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.FileNotFoundException
- Thrown if the file does not exist, is a directory, or cannot be opened for
reading.SecurityException
- Thrown if a security manager's checkRead
method denies read access to
the file.public T load(InputStream inputStream) throws IOException
inputStream
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(Path path) throws IOException
path
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(Reader reader) throws IOException
reader
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(String name) throws IOException
name
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(URI uri) throws IOException
uri
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.public T load(URL url) throws IOException
url
- the location of the properties file.IOException
- Thrown if an error occurred reading the input stream.IllegalArgumentException
- Thrown if the input contains a malformed Unicode escape sequence.Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.