You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/04/20 14:48:00 UTC

[jira] [Created] (LANG-1393) Add API SystemUtils.String getEnvironmentVariable(final String name, final String defaultValue)

Gary Gregory created LANG-1393:
----------------------------------

             Summary: Add API SystemUtils.String getEnvironmentVariable(final String name, final String defaultValue)
                 Key: LANG-1393
                 URL: https://issues.apache.org/jira/browse/LANG-1393
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
            Reporter: Gary Gregory
            Assignee: Gary Gregory
             Fix For: 3.8


Add API in {{SystemUtils}}:

{{String getEnvironmentVariable(final String name, final String defaultValue)}}

Javadoc:

{code:java}
    /**
     * <p>
     * Gets an environment variable, defaulting to {@code defaultValue} if the variable cannot be read.
     * </p>
     * <p>
     * If a {@code SecurityException} is caught, the return value is {@code defaultValue} and a message is written to
     * {@code System.err}.
     * </p>
     *
     * @param name
     *            the environment variable name
     * @param defaultValue
     *            the default value
     * @return the environment variable value or \{@code defaultValue} if a security problem occurs
     * @since 3.7
     */
    public static String getEnvironmentVariable(final String name, final String defaultValue) 
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)