From e782618a7c86093a47befe4e35957d1d3d3ee645 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 28 Mar 2012 18:54:01 +0200
Subject: Dump Envs: Suppress COOKIE, SSH and GPG env vars

---
 .../jogamp/common/util/TestSystemPropsAndEnvs.java | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

(limited to 'src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java')

diff --git a/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java b/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java
index d9afe1d..b182a6f 100644
--- a/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java
+++ b/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java
@@ -52,15 +52,30 @@ public class TestSystemPropsAndEnvs extends JunitTracer {
         System.out.println("Property count: "+i);
     }
     
+    private static String[] suppress_envs = new String[] { "COOKIE", "SSH", "GPG" };
+
+    private static boolean contains(String data, String[] search) {
+        if(null != data && null != search) {            
+            for(int i=0; i<search.length; i++) {
+                if(data.indexOf(search[i]) >= 0) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }    
+    
     @Test
     public void dumpEnvironment() {
         int i=0;
         Map<String, String> env = System.getenv();
         for (String envName : env.keySet()) {
-            i++;
-            System.out.format("%4d: %s = %s%n",
-                              i, envName,
-                              env.get(envName));
+            if(!contains(envName, suppress_envs)) {
+                i++;
+                System.out.format("%4d: %s = %s%n",
+                                  i, envName,
+                                  env.get(envName));
+            }
         }        
         System.out.println("Environment count: "+i);
     }
-- 
cgit v1.2.3