| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_144) on Wed Dec 11 21:05:30 MST 2019 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>PropertiesUtil (Apache Log4j API 2.13.0 API)</title> |
| <meta name="date" content="2019-12-11"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PropertiesUtil (Apache Log4j API 2.13.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":9,"i15":10,"i16":10,"i17":10,"i18":9,"i19":10,"i20":10,"i21":9,"i22":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/PropertiesUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/logging/log4j/util/PropertiesPropertySource.html" title="class in org.apache.logging.log4j.util"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/logging/log4j/util/PropertyFilePropertySource.html" title="class in org.apache.logging.log4j.util"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/logging/log4j/util/PropertiesUtil.html" target="_top">Frames</a></li> |
| <li><a href="PropertiesUtil.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.logging.log4j.util</div> |
| <h2 title="Class PropertiesUtil" class="title">Class PropertiesUtil</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.logging.log4j.util.PropertiesUtil</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public final class <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.49">PropertiesUtil</a> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block"><em>Consider this class private.</em> |
| <p> |
| Provides utility methods for managing <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util"><code>Properties</code></a> instances as well as access to the global configuration |
| system. Properties by default are loaded from the system properties, system environment, and a classpath resource |
| file named . Additional properties can be loaded by implementing a custom |
| <a href="../../../../../org/apache/logging/log4j/util/PropertySource.html" title="interface in org.apache.logging.log4j.util"><code>PropertySource</code></a> service and specifying it via a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html?is-external=true" title="class or interface in java.util"><code>ServiceLoader</code></a> file called |
| <code>META-INF/services/org.apache.logging.log4j.util.PropertySource</code> with a list of fully qualified class names |
| implementing that interface. |
| </p></div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/logging/log4j/util/PropertySource.html" title="interface in org.apache.logging.log4j.util"><code>PropertySource</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#PropertiesUtil-java.util.Properties-">PropertiesUtil</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> props)</code> |
| <div class="block">Constructs a PropertiesUtil using a given Properties object as its source of defined properties.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#PropertiesUtil-java.lang.String-">PropertiesUtil</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> propertiesFileName)</code> |
| <div class="block">Constructs a PropertiesUtil for a given properties file name on the classpath.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#extractSubset-java.util.Properties-java.lang.String-">extractSubset</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> prefix)</code> |
| <div class="block">Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties |
| object with the prefix removed.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getBooleanProperty-java.lang.String-">getBooleanProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getBooleanProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-">getBooleanProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>> supplier)</code> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getBooleanProperty-java.lang.String-boolean-">getBooleanProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| boolean defaultValue)</code> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getBooleanProperty-java.lang.String-boolean-boolean-">getBooleanProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| boolean defaultValueIfAbsent, |
| boolean defaultValueIfPresent)</code> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getCharsetProperty-java.lang.String-">getCharsetProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Gets the named property as a Charset value.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getCharsetProperty-java.lang.String-java.nio.charset.Charset-">getCharsetProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> defaultValue)</code> |
| <div class="block">Gets the named property as a Charset value.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getDoubleProperty-java.lang.String-double-">getDoubleProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| double defaultValue)</code> |
| <div class="block">Gets the named property as a double.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getDurationProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-">getDurationProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a>> supplier)</code> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getDurationProperty-java.lang.String-java.time.Duration-">getDurationProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a> defaultValue)</code> |
| <div class="block">Retrieves a Duration where the String is of the format nnn[unit] where nnn represents an integer value |
| and unit represents a time unit.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getIntegerProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-">getIntegerProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>> supplier)</code> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getIntegerProperty-java.lang.String-int-">getIntegerProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| int defaultValue)</code> |
| <div class="block">Gets the named property as an integer.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getLongProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-">getLongProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>> supplier)</code> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getLongProperty-java.lang.String-long-">getLongProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| long defaultValue)</code> |
| <div class="block">Gets the named property as a long.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>static <a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html" title="class in org.apache.logging.log4j.util">PropertiesUtil</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getProperties--">getProperties</a></span>()</code> |
| <div class="block">Returns the PropertiesUtil used by Log4j.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getStringProperty-java.lang.String-">getStringProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Gets the named property as a String.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getStringProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-">getStringProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> supplier)</code> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getStringProperty-java.lang.String-java.lang.String-">getStringProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</code> |
| <div class="block">Gets the named property as a String.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#getSystemProperties--">getSystemProperties</a></span>()</code> |
| <div class="block">Return the system properties or an empty Properties object if an error occurs.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#hasProperty-java.lang.String-">hasProperty</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Returns <code>true</code> if the specified property is defined, regardless of its value (it may not have a value).</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#isOsWindows--">isOsWindows</a></span>()</code> |
| <div class="block">Returns true if system properties tell us we are running on Windows.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#partitionOnCommonPrefixes-java.util.Properties-">partitionOnCommonPrefixes</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> properties)</code> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html#reload--">reload</a></span>()</code> |
| <div class="block">Reloads all properties.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="PropertiesUtil-java.util.Properties-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>PropertiesUtil</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.63">PropertiesUtil</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> props)</pre> |
| <div class="block">Constructs a PropertiesUtil using a given Properties object as its source of defined properties.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>props</code> - the Properties to use by default</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="PropertiesUtil-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>PropertiesUtil</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.73">PropertiesUtil</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> propertiesFileName)</pre> |
| <div class="block">Constructs a PropertiesUtil for a given properties file name on the classpath. The properties specified in this |
| file are used by default. If a property is not defined in this file, then the equivalent system property is used.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>propertiesFileName</code> - the location of properties file to load</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="getProperties--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getProperties</h4> |
| <pre>public static <a href="../../../../../org/apache/logging/log4j/util/PropertiesUtil.html" title="class in org.apache.logging.log4j.util">PropertiesUtil</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.107">getProperties</a>()</pre> |
| <div class="block">Returns the PropertiesUtil used by Log4j.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the main Log4j PropertiesUtil instance.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="hasProperty-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasProperty</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.117">hasProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">Returns <code>true</code> if the specified property is defined, regardless of its value (it may not have a value).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to verify</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the specified property is defined, regardless of its value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getBooleanProperty-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBooleanProperty</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.129">getBooleanProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">Gets the named property as a boolean value. If the property matches the string <code>"true"</code> (case-insensitive), |
| then it is returned as the boolean value <code>true</code>. Any other non-<code>null</code> text in the property is |
| considered <code>false</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the boolean value of the property or <code>false</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getBooleanProperty-java.lang.String-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBooleanProperty</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.140">getBooleanProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| boolean defaultValue)</pre> |
| <div class="block">Gets the named property as a boolean value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the boolean value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getBooleanProperty-java.lang.String-boolean-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBooleanProperty</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.153">getBooleanProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| boolean defaultValueIfAbsent, |
| boolean defaultValueIfPresent)</pre> |
| <div class="block">Gets the named property as a boolean value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValueIfAbsent</code> - the default value to use if the property is undefined</dd> |
| <dd><code>defaultValueIfPresent</code> - the default value to use if the property is defined but not assigned</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the boolean value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getBooleanProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBooleanProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.169">getBooleanProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>> supplier)</pre> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCharsetProperty-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCharsetProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.184">getCharsetProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">Gets the named property as a Charset value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the Charset value of the property or <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true#defaultCharset--" title="class or interface in java.nio.charset"><code>Charset.defaultCharset()</code></a> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCharsetProperty-java.lang.String-java.nio.charset.Charset-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCharsetProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.196">getCharsetProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> defaultValue)</pre> |
| <div class="block">Gets the named property as a Charset value. If we cannot find the named Charset, see if it is mapped in |
| file <code>Log4j-charsets.properties</code> on the class path.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the Charset value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getDoubleProperty-java.lang.String-double-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDoubleProperty</h4> |
| <pre>public double <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.223">getDoubleProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| double defaultValue)</pre> |
| <div class="block">Gets the named property as a double.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the parsed double value of the property or <code>defaultValue</code> if it was undefined or could not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getIntegerProperty-java.lang.String-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getIntegerProperty</h4> |
| <pre>public int <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.243">getIntegerProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| int defaultValue)</pre> |
| <div class="block">Gets the named property as an integer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the parsed integer value of the property or <code>defaultValue</code> if it was undefined or could not be |
| parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getIntegerProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getIntegerProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.264">getIntegerProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>> supplier)</pre> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getLongProperty-java.lang.String-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLongProperty</h4> |
| <pre>public long <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.280">getLongProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| long defaultValue)</pre> |
| <div class="block">Gets the named property as a long.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the parsed long value of the property or <code>defaultValue</code> if it was undefined or could not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getLongProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLongProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.301">getLongProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>> supplier)</pre> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getDurationProperty-java.lang.String-java.time.Duration-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDurationProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.318">getDurationProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a> defaultValue)</pre> |
| <div class="block">Retrieves a Duration where the String is of the format nnn[unit] where nnn represents an integer value |
| and unit represents a time unit.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - The property name.</dd> |
| <dd><code>defaultValue</code> - The default value.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value of the String as a Duration or the default value, which may be null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getDurationProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDurationProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.335">getDurationProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time">Duration</a>> supplier)</pre> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getStringProperty-java.lang.String:A-java.lang.String-org.apache.logging.log4j.util.Supplier-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getStringProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.353">getStringProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key, |
| <a href="../../../../../org/apache/logging/log4j/util/Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> supplier)</pre> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getStringProperty-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getStringProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.369">getStringProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block">Gets the named property as a String.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the String value of the property or <code>null</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getStringProperty-java.lang.String-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getStringProperty</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.380">getStringProperty</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</pre> |
| <div class="block">Gets the named property as a String.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the String value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSystemProperties--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSystemProperties</h4> |
| <pre>public static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.390">getSystemProperties</a>()</pre> |
| <div class="block">Return the system properties or an empty Properties object if an error occurs.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The system properties.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="reload--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>reload</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.405">reload</a>()</pre> |
| <div class="block">Reloads all properties. This is primarily useful for unit tests.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.10.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="extractSubset-java.util.Properties-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>extractSubset</h4> |
| <pre>public static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.524">extractSubset</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> prefix)</pre> |
| <div class="block">Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties |
| object with the prefix removed.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>properties</code> - The Properties to evaluate.</dd> |
| <dd><code>prefix</code> - The prefix to extract.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The subset of properties.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="partitionOnCommonPrefixes-java.util.Properties-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>partitionOnCommonPrefixes</h4> |
| <pre>public static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>> <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.560">partitionOnCommonPrefixes</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> properties)</pre> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>properties</code> - properties to partition</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the partitioned properties where each key is the common prefix (minus the period) and the values are |
| new property maps without the prefix and period in the key</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.6</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isOsWindows--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>isOsWindows</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/logging/log4j/util/PropertiesUtil.html#line.577">isOsWindows</a>()</pre> |
| <div class="block">Returns true if system properties tell us we are running on Windows.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if system properties tell us we are running on Windows.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/PropertiesUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/logging/log4j/util/PropertiesPropertySource.html" title="class in org.apache.logging.log4j.util"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/logging/log4j/util/PropertyFilePropertySource.html" title="class in org.apache.logging.log4j.util"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/logging/log4j/util/PropertiesUtil.html" target="_top">Frames</a></li> |
| <li><a href="PropertiesUtil.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small><p align="center">Copyright © 1999-2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.<br /> Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p></small></p> |
| </body> |
| </html> |