[izpack-changes] r1565 - izpack-src/trunk/src/lib/com/izforge/izpack/util

noreply at berlios.de noreply at berlios.de
Wed Sep 6 22:28:43 CEST 2006


Author: eppelman
Date: 2006-09-06 22:28:42 +0200 (Wed, 06 Sep 2006)
New Revision: 1565

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/util/UnixUserProcessor.java
Log:
-implemented  the X-KDE subsitute user - shortcut attribute (see Unix_shortcutSpec.xml).
-write Desktop shortcuts to all known local and ypbinded users "desktop" folders.
-write common shortcuts  to the new freedesktop.org common "/usr/share/applications" 
and "/usr/share/pixmaps" folders to display these in the commons [start].menu
Here: use now the new UnixHelper

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/util/UnixUserProcessor.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/util/UnixUserProcessor.java	2006-09-06 20:27:44 UTC (rev 1564)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/util/UnixUserProcessor.java	2006-09-06 20:28:42 UTC (rev 1565)
@@ -1,56 +1,45 @@
 /* 
-*  Copyright (C) 2004 Thorsten Kamann
-*
-*  File :               UnixUserProcessor.java
-*  Description :       Retrieves a list of the current users
-*  Author's email :     thorsten.kamann at planetes.de
-*  Author's Website :   http://www.izforge.com
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* 
-*     http://www.apache.org/licenses/LICENSE-2.0
-*     
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ *  Copyright (C) 2004 Thorsten Kamann
+ *
+ *  File :               UnixUserProcessor.java
+ *  Description :       Retrieves a list of the current users
+ *  Author's email :     thorsten.kamann at planetes.de
+ *  Author's Website :   http://www.izforge.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *     
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.izforge.izpack.util;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
-
 import com.izforge.izpack.panels.ProcessingClient;
 import com.izforge.izpack.panels.Processor;
+import com.izforge.izpack.util.os.unix.UnixUsers;
 
 /**
  * @author thorsten-kamann
  */
-public class UnixUserProcessor implements Processor {
+public class UnixUserProcessor implements Processor
+{
+    
+    
+    /**
+     * Overridden Method returns a list of users in the /etc/passwd
+     */
+    public String process(ProcessingClient client)
+    {
+        return UnixUsers.getUsersColonString();
+    }
+    
 
-	public String process (ProcessingClient client){
-		String retValue = "";
-		String filepath = "/etc/passwd";
-		BufferedReader reader = null;
-		String line = "";
-				
-		try{
-			reader = new BufferedReader(new FileReader(filepath));
-			while ((line = reader.readLine()) != null){
-				retValue += line.substring(0, line.indexOf(":"))+":";
-			}
-			if (retValue.endsWith(":")){
-				retValue = retValue.substring(0, retValue.length()-1);
-			}			
-		}catch (Exception ex){
-			retValue = "";
-		}
-		
-		return retValue;
-	}
 
 }




More information about the izpack-changes mailing list