Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java	(revision 27315)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java	(revision 27316)
@@ -19,18 +19,13 @@
 package org.greenstone.gsdl3.util;
 
-import javax.swing.*;
-
-import org.greenstone.gsdl3.service.Authentication;
-
-import java.io.File;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.sql.SQLWarning;
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Properties;
+
+import org.greenstone.gsdl3.service.Authentication;
 
 public class DerbyWrapper
@@ -87,51 +82,56 @@
 	public void closeDatabase()
 	{
-	        //state = null;
+		//state = null;
 		//conn = null;
 		boolean gotSQLExc = false;
 		try
-		    {
-		    //  shutdown the database
-		    DriverManager.getConnection(protocol_str + ";shutdown=true");
-			
-		    }
+		{
+			//  shutdown the database
+			DriverManager.getConnection(protocol_str + ";shutdown=true");
+
+		}
 		catch (SQLException se)
 		{
-		    // this is good (i.e. what Derby is designed to do on a successful shutdown)
-		    gotSQLExc = true;
-		}
-		catch (Exception e) {
-		    e.printStackTrace();
+			// this is good (i.e. what Derby is designed to do on a successful shutdown)
+			gotSQLExc = true;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
 		}
 
 		if (!gotSQLExc)
 		{
-		    System.err.println("Warning: Derby Database did not shut down normally");
-		}
-	}
-
-       public static void shutdownDatabaseServer()
-       {
-	   boolean gotSQLExc = false;
-
-	   try {
-	       //  shutdown the whole server
-	       DriverManager.getConnection(PROTOCOL + ";shutdown=true");
-	       
-	   }
-	   catch (SQLException se) {
-	       // this is good (i.e. what Derby is designed to do on a successful shutdown)
-	       gotSQLExc = true;
-	       //System.out.println("Shutdown returned: " + se);
-	   }
-	   catch (Exception e) {
-
-	       e.printStackTrace();
-	   }
-	   if (!gotSQLExc) {
-	       System.err.println("Warning: Derby did not shut down normally");
-	   }
-
-       }
+			System.err.println("Warning: Derby Database did not shut down normally");
+		}
+	}
+
+	public static void shutdownDatabaseServer()
+	{
+		boolean gotSQLExc = false;
+
+		try
+		{
+			//  shutdown the whole server
+			DriverManager.getConnection(PROTOCOL + ";shutdown=true");
+
+		}
+		catch (SQLException se)
+		{
+			// this is good (i.e. what Derby is designed to do on a successful shutdown)
+			gotSQLExc = true;
+			//System.out.println("Shutdown returned: " + se);
+		}
+		catch (Exception e)
+		{
+
+			e.printStackTrace();
+		}
+		if (!gotSQLExc)
+		{
+			System.err.println("Warning: Derby did not shut down normally");
+		}
+
+	}
 
 	public void createDatabase()
@@ -375,6 +375,6 @@
 	}
 
-    // findUser(null) will return all users, which is why a UserQueryResult 
-    // (a vector of UserTermInfo) is returned
+	// findUser(null) will return all users, which is why a UserQueryResult 
+	// (a vector of UserTermInfo) is returned
 	public UserQueryResult findUser(String username) throws SQLException
 	{
@@ -443,5 +443,5 @@
 			conn.setAutoCommit(false);
 			String sql_modify_user_info = "update " + USERS + " set ";
-			
+
 			boolean needComma = false;
 			if (new_password != null && !new_password.equals(""))
@@ -456,10 +456,10 @@
 				needComma = true;
 			}
-			
-			if(email != null)
+
+			if (email != null)
 			{
 				sql_modify_user_info += (needComma ? "," : "") + " email='" + email + "'";
 			}
-			
+
 			sql_modify_user_info += " where username='" + username + "'";
 			state.execute(sql_modify_user_info);
@@ -496,18 +496,18 @@
 	public void db2txt()
 	{
-	    System.err.println(db2txtString());		
+		System.err.println(db2txtString());
 	}
 
 	public String db2txtString()
 	{
-	    //String db2txt = "Error in converting db2txt string.";
-	    String db2txt = "";
-		try
-		{
-		    conn.setAutoCommit(false); // An exception at this line can happen when the GS3 tomcat server is already running
-		                               // and GS3 is already accessing the usersDB when this function independently tries to
-		                               // connect to it (via usersDB2txt.java's main(). For an explanation of the possible 
-		                               // reasons, see http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
-		                               // section "Embedded Derby supports multiple users in one JVM".
+		//String db2txt = "Error in converting db2txt string.";
+		String db2txt = "";
+		try
+		{
+			conn.setAutoCommit(false); // An exception at this line can happen when the GS3 tomcat server is already running
+										// and GS3 is already accessing the usersDB when this function independently tries to
+										// connect to it (via usersDB2txt.java's main(). For an explanation of the possible 
+										// reasons, see http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
+										// section "Embedded Derby supports multiple users in one JVM".
 			String sql_list_all_user = "select username, password, accountstatus, comment, email from " + USERS;
 			ResultSet rs = state.executeQuery(sql_list_all_user);
@@ -541,5 +541,5 @@
 				}
 				conn.commit();
-								
+
 				buffer.append("USERNAME = " + user.get("username"));
 				buffer.append("\nPASSWORD = " + user.get("password"));
@@ -548,5 +548,5 @@
 				buffer.append("\nCOMMENT = " + user.get("comment"));
 				buffer.append("\nEMAIL = " + user.get("email"));
-				buffer.append("\n-------------------------------------\n");				
+				buffer.append("\n-------------------------------------\n");
 			}
 			db2txt = buffer.toString();
@@ -558,6 +558,8 @@
 		{
 			ex.printStackTrace();
-		} finally {
-		    return db2txt;
+		}
+		finally
+		{
+			return db2txt;
 		}
 	}
