java.lang.Object
org.refcodes.properties.PropertiesSugar
Declarative syntactic sugar which may be statically imported in order to
allow declarative definitions for the construction of
Properties
precedences using ProfilePropertiesDecorator
,
ProfilePropertiesProjection
, ResourceProperties
or
PropertiesPrecedenceComposite
(and the like).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfileToJavaProperties
(Properties aProperties, File aFile) Files the Java properties to the givenFile
.fileToJavaProperties
(Properties aProperties, String aFilePath) Files the Java properties to the given file's path.fileToJsonProperties
(Properties aProperties, File aFile) Files the JSON properties to the givenFile
.fileToJsonProperties
(Properties aProperties, String aFilePath) Files the JSON properties to the given file's path.fileToTomlProperties
(Properties aProperties, File aFile) Files the TOML properties to the givenFile
.fileToTomlProperties
(Properties aProperties, String aFilePath) Files the TOML properties to the given file's path.fileToXmlProperties
(Properties aProperties, File aFile) Files the XML properties to the givenFile
.fileToXmlProperties
(Properties aProperties, String aFilePath) Files the XML properties to the given file's path.fileToYamlProperties
(Properties aProperties, File aFile) Files the YAML properties to the givenFile
.fileToYamlProperties
(Properties aProperties, String aFilePath) Files the YAML properties to the given file's path.static org.refcodes.struct.Property
Deprecated.Implemented to see how it feels like using it in my sourcesstatic Properties.PropertiesBuilder
from
(org.refcodes.struct.Property... aProperties) Deprecated.Implemented to see how it feels like using it in my sourcesstatic Properties
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, String... aProfiles) Wraps theProperties
with a profile projection.static Properties.PropertiesBuilder
fromProperties
(org.refcodes.struct.Property... aProperties) Creates aProperties
instance from the providedProperty
instances.static Properties
ReturnsProperties
representing the system properties as passed via the "-Dkey=value" when launching the JVM (e.g.java -Dconsole.width=220).loadFromJavaProperties
(File aFile) Loads the Java properties from the givenFile
.loadFromJavaProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.loadFromJavaProperties
(String aFilePath) Loads the Java properties from the given file's path.loadFromJavaProperties
(URL aUrl) Loads the Java properties from the givenURL
.loadFromJsonProperties
(File aFile) Loads the JSON properties from the givenFile
.loadFromJsonProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.loadFromJsonProperties
(String aFilePath) Loads the JSON properties from the given file's path.loadFromJsonProperties
(URL aUrl) Loads the JSON properties from the givenURL
.loadFromTomlProperties
(File aFile) Loads the TOML properties from the givenFile
.loadFromTomlProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.loadFromTomlProperties
(String aFilePath) Loads the TOML properties from the given file's path.loadFromTomlProperties
(URL aUrl) Loads the TOML properties from the givenURL
.loadFromXmlProperties
(File aFile) Loads the XML properties from the givenFile
.loadFromXmlProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.loadFromXmlProperties
(String aFilePath) Loads the XML properties from the given file's path.loadFromXmlProperties
(URL aUrl) Loads the XML properties from the givenURL
.loadFromYamlProperties
(File aFile) Loads the YAML properties from the givenFile
.loadFromYamlProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.loadFromYamlProperties
(String aFilePath) Loads the YAML properties from the given file's path.loadFromYamlProperties
(URL aUrl) Loads the YAML properties from the givenURL
.saveToJavaProperties
(Properties aProperties, File aFile) Saves the Java properties to the givenFile
.saveToJavaProperties
(Properties aProperties, OutputStream aOutputStream) Writes the properties to the givenOutputStream
.saveToJavaProperties
(Properties aProperties, String aFilePath) Saves the Java properties to the given file's path.saveToJsonProperties
(Properties aProperties, File aFile) Saves the JSON properties to the givenFile
.saveToJsonProperties
(Properties aProperties, OutputStream aOutputStream) Writes the properties to the givenOutputStream
.saveToJsonProperties
(Properties aProperties, String aFilePath) Saves the JSON properties to the given file's path.saveToTomlProperties
(Properties aProperties, File aFile) Saves the TOML properties to the givenFile
.saveToTomlProperties
(Properties aProperties, OutputStream aOutputStream) Writes the properties to the givenOutputStream
.saveToTomlProperties
(Properties aProperties, String aFilePath) Saves the TOML properties to the given file's path.saveToXmlProperties
(Properties aProperties, File aFile) Saves the XML properties to the givenFile
.saveToXmlProperties
(Properties aProperties, OutputStream aOutputStream) Writes the properties to the givenOutputStream
.saveToXmlProperties
(Properties aProperties, String aFilePath) Saves the XML properties to the given file's path.saveToYamlProperties
(Properties aProperties, File aFile) Saves the YAML properties to the givenFile
.saveToYamlProperties
(Properties aProperties, OutputStream aOutputStream) Writes the properties to the givenOutputStream
.saveToYamlProperties
(Properties aProperties, 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 ofIoPollLoopTime.NORM
and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties) Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeMillis) 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
).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeMillis, 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
).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeMillis, 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).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeMillis, 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).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 ofIoPollLoopTime.NORM
) and orphan removal (as ofResourceProperties.reload(ReloadMode)
being called withReloadMode.ORPHAN_REMOVAL
).schedule
(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode) Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofIoPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).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 ofIoPollLoopTime.NORM
) and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).static ScheduledResourceProperties
schedule
(ResourceProperties aProperties, int aScheduleTimeMillis) 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 aScheduleTimeMillis, 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, int aScheduleTimeMillis, 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 aScheduleTimeMillis, 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, org.refcodes.controlflow.ThreadMode aThreadMode) Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.NORM
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 ofIoPollLoopTime.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 ofIoPollLoopTime.NORM
and the given orphan removal strategy (as ofResourceProperties.reload(ReloadMode)
being called with your argument).seekFromJavaProperties
(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.seekFromJavaProperties
(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.seekFromJsonProperties
(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.seekFromJsonProperties
(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.seekFromTomlProperties
(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.seekFromTomlProperties
(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.seekFromXmlProperties
(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.seekFromXmlProperties
(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.seekFromYamlProperties
(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.seekFromYamlProperties
(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
Creates an emptyProperties.PropertiesBuilder
.static Properties.PropertiesBuilder
toPropertiesBuilder
(Properties... aProperties) Creates a newProperties.PropertiesBuilder
from theProperties
.static org.refcodes.struct.Property
toProperty
(String aKey, String aValue) Creates aProperty
from the provided key and the provided value.
-
Constructor Details
-
PropertiesSugar
public PropertiesSugar()
-
-
Method Details
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(InputStream aInputStream) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJavaProperties(URL aUrl) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJavaProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJavaProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(InputStream aInputStream) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromTomlProperties(URL aUrl) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromTomlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromTomlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(InputStream aInputStream) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromJsonProperties(URL aUrl) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJsonProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromJsonProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(InputStream aInputStream) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromYamlProperties(URL aUrl) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromYamlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromYamlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(InputStream aInputStream) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
loadFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder loadFromXmlProperties(URL aUrl) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromXmlProperties(File aFile) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
seekFromXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder seekFromXmlProperties(String aFilePath) throws IOException, 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:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJavaProperties(Properties aProperties, OutputStream aOutputStream) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToTomlProperties(Properties aProperties, OutputStream aOutputStream) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToJsonProperties(Properties aProperties, OutputStream aOutputStream) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToYamlProperties(Properties aProperties, OutputStream aOutputStream) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
saveToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder saveToXmlProperties(Properties aProperties, OutputStream aOutputStream) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJavaProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToJavaProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJavaProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToTomlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToTomlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToTomlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJsonProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToJsonProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToJsonProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToYamlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToYamlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToYamlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToXmlProperties(Properties aProperties, File aFile) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
fileToXmlProperties
public static ResourceProperties.ResourcePropertiesBuilder fileToXmlProperties(Properties aProperties, String aFilePath) throws 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:
IOException
- thrown in case writing or processing the properties file failed.
-
toPrecedence
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
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
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
Creates an emptyProperties.PropertiesBuilder
.- Returns:
- The newly created empty
Properties.PropertiesBuilder
.
-
toPropertiesBuilder
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
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.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.struct.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.struct.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
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
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
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
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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeMillis) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- The time in milliseconds between polling for new properties.- Returns:
- the
ScheduledResourceProperties
encapsulating the providedResourceProperties
. - Throws:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeMillis, ReloadMode aReloadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 aScheduleTimeMillis) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- The time in milliseconds between polling for new properties.- Returns:
- the
ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
encapsulating the providedResourceProperties.ResourcePropertiesBuilder
. - Throws:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 aScheduleTimeMillis, ReloadMode aReloadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeMillis, org.refcodes.controlflow.ThreadMode aThreadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesDecorator
wrapping the givenResourceProperties
with setting the the default poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
schedule
public static ScheduledResourceProperties schedule(ResourceProperties aProperties, int aScheduleTimeMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 aScheduleTimeMillis, org.refcodes.controlflow.ThreadMode aThreadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 IllegalStateException, IOException, ParseException Creates aScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofIoPollLoopTime.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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.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 aScheduleTimeMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws IllegalStateException, IOException, 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.aScheduleTimeMillis
- 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:
IOException
- thrown in case accessing the resource encountered an I/O problem.IllegalStateException
- in case the attached resource does not support reloading.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-