From 884f414754a93fceec4c42913510c767ee477250 Mon Sep 17 00:00:00 2001 From: sjfink Date: Thu, 1 Mar 2007 15:16:49 +0000 Subject: [PATCH] delete obsolete junk git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@824 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- com.ibm.wala.core/META-INF/MANIFEST.MF | 1 - .../com/ibm/wala/util/system/Environment.java | 65 ------------------- 2 files changed, 66 deletions(-) delete mode 100644 com.ibm.wala.core/src/com/ibm/wala/util/system/Environment.java diff --git a/com.ibm.wala.core/META-INF/MANIFEST.MF b/com.ibm.wala.core/META-INF/MANIFEST.MF index a840c63b9..ab111edc7 100644 --- a/com.ibm.wala.core/META-INF/MANIFEST.MF +++ b/com.ibm.wala.core/META-INF/MANIFEST.MF @@ -63,6 +63,5 @@ Export-Package: ., com.ibm.wala.util.math, com.ibm.wala.util.perf, com.ibm.wala.util.scope, - com.ibm.wala.util.system, com.ibm.wala.util.warnings, com.ibm.wala.viz diff --git a/com.ibm.wala.core/src/com/ibm/wala/util/system/Environment.java b/com.ibm.wala.core/src/com/ibm/wala/util/system/Environment.java deleted file mode 100644 index efd31e8b0..000000000 --- a/com.ibm.wala.core/src/com/ibm/wala/util/system/Environment.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002 - 2006 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package com.ibm.wala.util.system; - -import java.io.BufferedReader; -import java.io.File; -import java.io.StringReader; -import java.util.HashMap; -import java.util.Map; - -import com.ibm.wala.dynamic.BasicLauncher; -import com.ibm.wala.util.debug.Assertions; -import com.ibm.wala.util.warnings.WalaException; - -/** - * Read the system environment as a Map - */ -public class Environment { - - /* - * (non-Javadoc) - * - * @see com.ibm.capa.core.impl.EAnalysisEngineImpl#processImpl() - */ - public static Map readEnv() throws WalaException { - BasicLauncher b = new BasicLauncher(true); - if (File.separatorChar == '\\') - b.setCmd("cmd.exe /Cset"); - else - b.setCmd("printenv"); - b.launch(); - return parseOutput(b.getOutput()); - } - - /** - * @param b - * a set of lines of the form KEY=value - */ - private static Map parseOutput(byte[] b) { - String s = new String(b); - HashMap result = new HashMap(); - BufferedReader br = new BufferedReader(new StringReader(s)); - try { - String line = br.readLine(); - while (line != null) { - int i = line.indexOf('='); - String key = line.substring(0, i); - String value = line.substring(i + 1); - result.put(key, value); - line = br.readLine(); - } - } catch (Exception e) { - Assertions.UNREACHABLE(); - } - return result; - } -} // Environment