Package org.refcodes.configuration
Class PropertiesSugar
- java.lang.Object
-
- org.refcodes.configuration.PropertiesSugar
-
public class PropertiesSugar extends java.lang.Object
Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for the construction ofProperties
precedences usingProfilePropertiesDecorator
,ProfilePropertiesProjection
,ResourceProperties
orPropertiesPrecedenceComposite
(and the like).
-
-
Constructor Summary
Constructors Constructor Description PropertiesSugar()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ResourceProperties.ResourcePropertiesBuilder
fileToJavaProperties(Properties aProperties, java.io.File aFile)
Files the Java properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
fileToJavaProperties(Properties aProperties, java.lang.String aFilePath)
Files the Java properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
fileToJsonProperties(Properties aProperties, java.io.File aFile)
Files the JSON properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
fileToJsonProperties(Properties aProperties, java.lang.String aFilePath)
Files the JSON properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
fileToTomlProperties(Properties aProperties, java.io.File aFile)
Files the TOML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
fileToTomlProperties(Properties aProperties, java.lang.String aFilePath)
Files the TOML properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
fileToXmlProperties(Properties aProperties, java.io.File aFile)
Files the XML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
fileToXmlProperties(Properties aProperties, java.lang.String aFilePath)
Files the XML properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
fileToYamlProperties(Properties aProperties, java.io.File aFile)
Files the YAML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
fileToYamlProperties(Properties aProperties, java.lang.String aFilePath)
Files the YAML properties to the given file's path.static org.refcodes.structure.Property
from(java.lang.String aKey, java.lang.String aValue)
Deprecated.Implemented to see how it feels like using it in my sourcesstatic Properties.PropertiesBuilder
from(org.refcodes.structure.Property... aProperties)
Deprecated.Implemented to see how it feels like using it in my sourcesstatic Properties
fromEnvironmentVariables()
ReturnsProperties
representing the operating system's environment variables as ofenv
on Linux or Unix shells orset
on Windows machines.static Properties
fromProfile(Properties aProperties)
Wraps theProperties
with a profile projection.static Properties
fromProfile(Properties aProperties, java.lang.String... aProfiles)
Wraps theProperties
with a profile projection.static Properties.PropertiesBuilder
fromProperties(org.refcodes.structure.Property... aProperties)
Creates aProperties
instance from the providedProperty
instances.static Properties
fromSystemProperties()
ReturnsProperties
representing the system properties as passed via the "-Dkey=value" when launching the JVM (e.g.java -Dconsole.width=220).static ResourceProperties.ResourcePropertiesBuilder
loadFromJavaProperties(java.io.File aFile)
Loads the Java properties from the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
loadFromJavaProperties(java.io.InputStream aInputStream)
Reads the properties from the givenInputStream
.static ResourceProperties.ResourcePropertiesBuilder
loadFromJavaProperties(java.lang.String aFilePath)
Loads the Java properties from the given file's path.static ResourceProperties.ResourcePropertiesBuilder
loadFromJavaProperties(java.net.URL aUrl)
Loads the Java properties from the givenURL
.static ResourceProperties.ResourcePropertiesBuilder
loadFromJsonProperties(java.io.File aFile)
Loads the JSON properties from the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
loadFromJsonProperties(java.io.InputStream aInputStream)
Reads the properties from the givenInputStream
.static ResourceProperties.ResourcePropertiesBuilder
loadFromJsonProperties(java.lang.String aFilePath)
Loads the JSON properties from the given file's path.static ResourceProperties.ResourcePropertiesBuilder
loadFromJsonProperties(java.net.URL aUrl)
Loads the JSON properties from the givenURL
.static ResourceProperties.ResourcePropertiesBuilder
loadFromTomlProperties(java.io.File aFile)
Loads the TOML properties from the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
loadFromTomlProperties(java.io.InputStream aInputStream)
Reads the properties from the givenInputStream
.static ResourceProperties.ResourcePropertiesBuilder
loadFromTomlProperties(java.lang.String aFilePath)
Loads the TOML properties from the given file's path.static ResourceProperties.ResourcePropertiesBuilder
loadFromTomlProperties(java.net.URL aUrl)
Loads the TOML properties from the givenURL
.static ResourceProperties.ResourcePropertiesBuilder
loadFromXmlProperties(java.io.File aFile)
Loads the XML properties from the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
loadFromXmlProperties(java.io.InputStream aInputStream)
Reads the properties from the givenInputStream
.static ResourceProperties.ResourcePropertiesBuilder
loadFromXmlProperties(java.lang.String aFilePath)
Loads the XML properties from the given file's path.static ResourceProperties.ResourcePropertiesBuilder
loadFromXmlProperties(java.net.URL aUrl)
Loads the XML properties from the givenURL
.static ResourceProperties.ResourcePropertiesBuilder
loadFromYamlProperties(java.io.File aFile)
Loads the YAML properties from the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
loadFromYamlProperties(java.io.InputStream aInputStream)
Reads the properties from the givenInputStream
.static ResourceProperties.ResourcePropertiesBuilder
loadFromYamlProperties(java.lang.String aFilePath)
Loads the YAML properties from the given file's path.static ResourceProperties.ResourcePropertiesBuilder
loadFromYamlProperties(java.net.URL aUrl)
Loads the YAML properties from the givenURL
.static ResourceProperties.ResourcePropertiesBuilder
saveToJavaProperties(Properties aProperties, java.io.File aFile)
Saves the Java properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
saveToJavaProperties(Properties aProperties, java.io.OutputStream aOutputStream)
Writes the properties to the givenOutputStream
.static ResourceProperties.ResourcePropertiesBuilder
saveToJavaProperties(Properties aProperties, java.lang.String aFilePath)
Saves the Java properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
saveToJsonProperties(Properties aProperties, java.io.File aFile)
Saves the JSON properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
saveToJsonProperties(Properties aProperties, java.io.OutputStream aOutputStream)
Writes the properties to the givenOutputStream
.static ResourceProperties.ResourcePropertiesBuilder
saveToJsonProperties(Properties aProperties, java.lang.String aFilePath)
Saves the JSON properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
saveToTomlProperties(Properties aProperties, java.io.File aFile)
Saves the TOML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
saveToTomlProperties(Properties aProperties, java.io.OutputStream aOutputStream)
Writes the properties to the givenOutputStream
.static ResourceProperties.ResourcePropertiesBuilder
saveToTomlProperties(Properties aProperties, java.lang.String aFilePath)
Saves the TOML properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
saveToXmlProperties(Properties aProperties, java.io.File aFile)
Saves the XML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
saveToXmlProperties(Properties aProperties, java.io.OutputStream aOutputStream)
Writes the properties to the givenOutputStream
.static ResourceProperties.ResourcePropertiesBuilder
saveToXmlProperties(Properties aProperties, java.lang.String aFilePath)
Saves the XML properties to the given file's path.static ResourceProperties.ResourcePropertiesBuilder
saveToYamlProperties(Properties aProperties, java.io.File aFile)
Saves the YAML properties to the givenFile
.static ResourceProperties.ResourcePropertiesBuilder
saveToYamlProperties(Properties aProperties, java.io.OutputStream aOutputStream)
Writes the properties to the givenOutputStream
.static ResourceProperties.ResourcePropertiesBuilder
saveToYamlProperties(Properties aProperties, java.lang.String aFilePath)
Saves the YAML properties to the given file's path.static ScheduledResourceProperties
schedule(ResourceProperties aProperties)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, int aScheduleTimeInMillis)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, ReloadMode aReloadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties
schedule(ResourceProperties aProperties, org.refcodes.controlflow.ThreadMode aThreadMode)
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).static ResourceProperties.ResourcePropertiesBuilder
seekFromJavaProperties(java.io.File aFile)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromJavaProperties(java.lang.String aFilePath)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromJsonProperties(java.io.File aFile)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromJsonProperties(java.lang.String aFilePath)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromTomlProperties(java.io.File aFile)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromTomlProperties(java.lang.String aFilePath)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromXmlProperties(java.io.File aFile)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromXmlProperties(java.lang.String aFilePath)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromYamlProperties(java.io.File aFile)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static ResourceProperties.ResourcePropertiesBuilder
seekFromYamlProperties(java.lang.String aFilePath)
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration.static Properties
toNormalized(Properties aProperties)
Decorates the providedProperties
with additional behavior by normalizing the key representing the path pointing to the according value.static Properties
toNormalized(Properties aProperties, char[] aDelimiters)
Decorates the providedProperties
with additional behavior by normalizing the key representing the path pointing to the according value.static Properties
toPrecedence(Properties... aProperties)
Creates aProperties
composite querying the providedProperties
in the given order.static Properties.PropertiesBuilder
toPropertiesBuilder()
Creates an emptyProperties.PropertiesBuilder
.static Properties.PropertiesBuilder
toPropertiesBuilder(Properties... aProperties)
Creates a newProperties.PropertiesBuilder
from theProperties
.static org.refcodes.structure.Property
toProperty(java.lang.String aKey, java.lang.String aValue)
Creates aProperty
from the provided key and the provided value.
-
-
-
Method Detail
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the Java properties from the givenFile
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the Java properties from the given file's path. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the properties from the givenInputStream
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the Java properties from the givenURL
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJavaProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJavaProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the TOML properties from the givenFile
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the TOML properties from the given file's path. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the properties from the givenInputStream
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the TOML properties from the givenURL
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromTomlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromTomlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the JSON properties from the givenFile
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the JSON properties from the given file's path. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the properties from the givenInputStream
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the JSON properties from the givenURL
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJsonProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJsonProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the YAML properties from the givenFile
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the YAML properties from the given file's path. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the properties from the givenInputStream
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the YAML properties from the givenURL
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromYamlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromYamlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the XML properties from the givenFile
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the XML properties from the given file's path. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the properties from the givenInputStream
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the XML properties from the givenURL
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromXmlProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromXmlProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification of theConfigLocator.ALL
configuration. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The according
Properties
instance. - Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Saves the Java properties to the givenFile
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Saves the Java properties to the given file's path. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, java.io.OutputStream aOutputStream) throws java.io.IOException
Writes the properties to the givenOutputStream
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aProperties
- TheProperties
to save.aOutputStream
- TheOutputStream
to which to write the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Saves the TOML properties to the givenFile
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Saves the TOML properties to the given file's path. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, java.io.OutputStream aOutputStream) throws java.io.IOException
Writes the properties to the givenOutputStream
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aProperties
- TheProperties
to save.aOutputStream
- TheOutputStream
to which to write the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Saves the JSON properties to the givenFile
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Saves the JSON properties to the given file's path. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, java.io.OutputStream aOutputStream) throws java.io.IOException
Writes the properties to the givenOutputStream
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aProperties
- TheProperties
to save.aOutputStream
- TheOutputStream
to which to write the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Saves the YAML properties to the givenFile
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Saves the YAML properties to the given file's path. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, java.io.OutputStream aOutputStream) throws java.io.IOException
Writes the properties to the givenOutputStream
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aProperties
- TheProperties
to save.aOutputStream
- TheOutputStream
to which to write the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Saves the XML properties to the givenFile
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Saves the XML properties to the given file's path. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, java.io.OutputStream aOutputStream) throws java.io.IOException
Writes the properties to the givenOutputStream
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aProperties
- TheProperties
to save.aOutputStream
- TheOutputStream
to which to write the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJavaProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Files the Java properties to the givenFile
. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJavaProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Files the Java properties to the given file's path. For Java properties, see "https://en.wikipedia.org/wiki/.properties".- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToTomlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Files the TOML properties to the givenFile
. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToTomlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Files the TOML properties to the given file's path. For TOML properties, see "https://en.wikipedia.org/wiki/TOML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJsonProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Files the JSON properties to the givenFile
. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJsonProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Files the JSON properties to the given file's path. For JSON properties, see "https://en.wikipedia.org/wiki/JSON"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToYamlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Files the YAML properties to the givenFile
. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToYamlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Files the YAML properties to the given file's path. For YAML properties, see "https://en.wikipedia.org/wiki/YAML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToXmlProperties(Properties aProperties, java.io.File aFile) throws java.io.IOException
Files the XML properties to the givenFile
. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aProperties
- TheProperties
to save.aFile
- TheFile
to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
fileToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToXmlProperties(Properties aProperties, java.lang.String aFilePath) throws java.io.IOException
Files the XML properties to the given file's path. For XML properties, see "https://en.wikipedia.org/wiki/XML"- Parameters:
aProperties
- TheProperties
to save.aFilePath
- The path to the file to which to save the properties.- Returns:
- The according
ResourceProperties
instance. - Throws:
java.io.IOException
- thrown in case writing or processing the properties file failed.
-
toPrecedence
public static Properties toPrecedence(Properties... aProperties)
Creates aProperties
composite querying the providedProperties
in the given order. Queried properties of the firstProperties
instance containing them are returned.Properties
before have a higher precedence overProperties
provided next.- Parameters:
aProperties
- TheProperties
to be queried in the provided order.- Returns:
- A
Properties
composite querying the provided properties in the given order.
-
toNormalized
public static Properties toNormalized(Properties aProperties)
Decorates the providedProperties
with additional behavior by normalizing the key representing the path pointing to the according value. You provideProperties
with a path delimiter different from the default delimiter and you getProperties
which act as if the delimiter was the default delimiter: Paths containing the namespace delimiter "." (as ofDelimiter.NAMESPACE
are converted to paths' with delimiter "/" (as ofDelimiter.PATH
. Changes applied to the providedProperties
affect the decorator.- Parameters:
aProperties
- TheProperties
to be decorated.- Returns:
- A
Properties
decorator normalizing the the providedProperties
' paths.
-
toNormalized
public static Properties toNormalized(Properties aProperties, char[] aDelimiters)
Decorates the providedProperties
with additional behavior by normalizing the key representing the path pointing to the according value. You provideProperties
with a path delimiter different from the default delimiter and you getProperties
which act as if the delimiter was the default delimiter: Paths containing the provided delimiters are converted to the paths' with delimiter "/" (as ofDelimiter.PATH
. Changes applied to the providedProperties
affect the decorator.- Parameters:
aProperties
- TheProperties
to be decorated.aDelimiters
- The delimiters to be converted forth and back- Returns:
- A
Properties
decorator normalizing the the providedProperties
' paths.
-
toPropertiesBuilder
public static Properties.PropertiesBuilder toPropertiesBuilder()
Creates an emptyProperties.PropertiesBuilder
.- Returns:
- The newly created empty
Properties.PropertiesBuilder
.
-
toPropertiesBuilder
public static Properties.PropertiesBuilder toPropertiesBuilder(Properties... aProperties)
Creates a newProperties.PropertiesBuilder
from theProperties
. Succeeding providedProperties
overrule provided precedingProperties
.- Parameters:
aProperties
- TheProperties
to be added to the resultingProperties.PropertiesBuilder
. The later theProperties
in the varargs chain, the more do they overrule the earlierProperties
from the varargs chain.- Returns:
- The
Properties.PropertiesBuilder
containing the provided properties.
-
toProperty
public static org.refcodes.structure.Property toProperty(java.lang.String aKey, java.lang.String aValue)
Creates aProperty
from the provided key and the provided value.- Parameters:
aKey
- The name of the property.aValue
- The value of the property.- Returns:
- he
Property
representing the key/value-pair.
-
from
@Deprecated public static org.refcodes.structure.Property from(java.lang.String aKey, java.lang.String aValue)
Deprecated.Implemented to see how it feels like using it in my sourcesCreates aProperty
from the provided key and the provided value.- Parameters:
aKey
- The name of the property.aValue
- The value of the property.- Returns:
- The
Property
representing the key/value-pair.
-
fromProperties
public static Properties.PropertiesBuilder fromProperties(org.refcodes.structure.Property... aProperties)
Creates aProperties
instance from the providedProperty
instances. UsetoProperty(String, String)
to compose your properties to be added.- Parameters:
aProperties
- TheProperty
instances' key/value-pairs to be added.- Returns:
- The according
Properties.PropertiesBuilder
containing the providedProperty
instances.
-
from
@Deprecated public static Properties.PropertiesBuilder from(org.refcodes.structure.Property... aProperties)
Deprecated.Implemented to see how it feels like using it in my sourcesCreates aProperties
instance from the providedProperty
instances. UsetoProperty(String, String)
to compose your properties to be added.- Parameters:
aProperties
- TheProperty
instances' key/value-pairs to be added.- Returns:
- The according
Properties.PropertiesBuilder
containing the providedProperty
instances.
-
fromSystemProperties
public static Properties fromSystemProperties()
ReturnsProperties
representing the system properties as passed via the "-Dkey=value" when launching the JVM (e.g.java -Dconsole.width=220).- Returns:
- The current JVM's system properties.
-
fromEnvironmentVariables
public static Properties fromEnvironmentVariables()
ReturnsProperties
representing the operating system's environment variables as ofenv
on Linux or Unix shells orset
on Windows machines.- Returns:
- The current JVM's system properties.
-
fromProfile
public static Properties fromProfile(Properties aProperties, java.lang.String... aProfiles)
Wraps theProperties
with a profile projection. TheProperties
are decorated with aProfilePropertiesProjection
which represents the wrappedProperties
with the given profiles applied. See alsoProfileProperties.toRuntimeProfile(String...)
.- Parameters:
aProperties
- The properties which are to be projected according to the provided profiles. The evaluation is done as ofProfileProperties.toRuntimeProfile(String...)
.aProfiles
- The profiles to be used when constructing the projection.- Returns:
- The
Properties
projection as of the provided profiles.
-
fromProfile
public static Properties fromProfile(Properties aProperties)
Wraps theProperties
with a profile projection. TheProperties
are decorated with aProfilePropertiesProjection
which represents the wrappedProperties
with the given profiles applied. See alsoProfileProperties.toRuntimeProfile(String...)
. The profiles being used are found at the givenProperties
"runtime/profiles" path as defined byPropertiesPath.RUNTIME_PROFILES_PATH
. This path points to an array with the Runtime-Profiles denoted as follows, pointing to your active Runtime-Profiles:- runtime/profiles/0=local
- runtime/profiles/1=oauth
- runtime/profiles/2=development
runtime/profiles=local,oauth,development
This array beats the above kind of declaration so that the active Runtime-Profiles can easily be overwritten byProfileProperties
supporting Java System-Properties (passed to the JVM via "-Dx=y") e.g. theRuntimePropertiesComposite
found in therefcodes-runtime
artifact.- Parameters:
aProperties
- The properties which are to be projected according to the profiles provided by the givenProperties
. The evaluation is done as ofProfileProperties.toRuntimeProfile()
.- Returns:
- The
Properties
projection as of the profiles provided by the givenProperties
.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeInMillis) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, ReloadMode aReloadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties. The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
).- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties.ScheduledResourcePropertiesBuilder schedule(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.lang.IllegalStateException, java.io.IOException, java.text.ParseException
Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
-