@@ -0,0 +1,1950 @@
+/*%0A * Copyright (c) 2013-2018 Cinchapi Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.cinchapi.common.unsafe;%0A%0Aimport java.util.Map;%0A%0Aimport com.cinchapi.common.reflect.Reflection;%0A%0A/**%0A * Hacks for environment variables%0A *%0A * @author Jeff Nelson%0A */%0Apublic class EnvironmentVariables %7B%0A%0A    /**%0A     * Set the environment variables to %7B@code vars%7D. This method will remove%0A     * any existing environment variables and set the ones provided.%0A     * %3Cp%3E%0A     * NOTE: This does not modify any environmental variables in the underlying%0A     * system. Instead, it modifies the JVM's cached copy of the env vars.%0A     * %3C/p%3E%0A     * %0A     * @param vars%0A     */%0A    public static void setAs(Map%3CString, String%3E vars) %7B%0A        try %7B%0A            Class%3C?%3E processEnvironmentClass = Reflection%0A                    .getClassCasted(%22java.lang.ProcessEnvironment%22);%0A            Map%3CString, String%3E env = Reflection.getStatic(%22theEnvironment%22,%0A                    processEnvironmentClass);%0A            env.clear();%0A            env.putAll(vars);%0A            Map%3CString, String%3E cienv = Reflection.getStatic(%0A                    %22theCaseInsensitiveEnvironment%22, processEnvironmentClass);%0A            cienv.clear();%0A            cienv.putAll(vars);%0A        %7D%0A        catch (Exception e) %7B%0A            Map%3CString, String%3E map = Reflection.get(%22m%22, System.getenv());%0A            map.clear();%0A            map.putAll(vars);%0A        %7D%0A    %7D%0A%0A%7D%0A

add EnvironmentVariables class