4639N/A/*
4639N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4639N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4639N/A *
4639N/A * This code is free software; you can redistribute it and/or modify it
4639N/A * under the terms of the GNU General Public License version 2 only, as
4639N/A * published by the Free Software Foundation. Oracle designates this
4639N/A * particular file as subject to the "Classpath" exception as provided
4639N/A * by Oracle in the LICENSE file that accompanied this code.
4639N/A *
4639N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4639N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4639N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4639N/A * version 2 for more details (a copy is included in the LICENSE file that
4639N/A * accompanied this code).
4639N/A *
4639N/A * You should have received a copy of the GNU General Public License version
4639N/A * 2 along with this work; if not, write to the Free Software Foundation,
4639N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4639N/A *
4639N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4639N/A * or visit www.oracle.com if you need additional information or have any
4639N/A * questions.
4639N/A */
4639N/A
4639N/A#import "PropertiesUtilities.h"
4639N/A
4639N/A@implementation PropertiesUtilities
4639N/A
4639N/A+ (NSString *) javaSystemPropertyForKey:(NSString *)key withEnv:(JNIEnv *)env {
4639N/A static JNF_CLASS_CACHE(jc_System, "java/lang/System");
4639N/A static JNF_STATIC_MEMBER_CACHE(jm_getProperty, jc_System, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;");
4730N/A
4639N/A jstring jKey = JNFNSToJavaString(env, key);
4639N/A jstring jValue = JNFCallStaticObjectMethod(env, jm_getProperty, jKey);
4639N/A (*env)->DeleteLocalRef(env, jKey);
4730N/A
4639N/A NSString *value = JNFJavaToNSString(env, jValue);
4639N/A (*env)->DeleteLocalRef(env, jValue);
4639N/A return value;
4639N/A}
4639N/A
4639N/A@end