qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r733016 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security: access/management/AMQUserManagementMBean.java auth/database/Base64MD5PasswordFilePrincipalDatabase.java
Date Fri, 09 Jan 2009 12:03:04 GMT
Author: aidan
Date: Fri Jan  9 04:03:03 2009
New Revision: 733016

URL: http://svn.apache.org/viewvc?rev=733016&view=rev
Log:
QPID-1563: Use createTempFile

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java?rev=733016&r1=733015&r2=733016&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
Fri Jan  9 04:03:03 2009
@@ -396,23 +396,11 @@
             _accessRightsUpdate.lock();
             try
             {
-                // remove old temporary file
-                File tmp = new File(_accessFileName + ".tmp");
-                if (tmp.exists())
-                {
-                    tmp.delete();
-                }
-
-                //remove old backup
-                File old = new File(_accessFileName + ".old");
-                if (old.exists())
-                {
-                    old.delete();
-                }
+                // Create temporary file
+                File tmp = File.createTempFile(_accessFileName, ".tmp");
 
                 // Rename current file
                 File rights = new File(_accessFileName);
-                rights.renameTo(old);
 
                 FileOutputStream output = new FileOutputStream(tmp);
                 _accessRights.store(output, "Generated by AMQUserManagementMBean Console
: Last edited by user:" + getCurrentJMXUser());

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java?rev=733016&r1=733015&r2=733016&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
Fri Jan  9 04:03:03 2009
@@ -386,11 +386,7 @@
 
             BufferedReader reader = null;
             PrintStream writer = null;
-            File tmp = new File(_passwordFile.getAbsolutePath() + ".tmp");
-            if (tmp.exists())
-            {
-                tmp.delete();
-            }
+            File tmp = File.createTempFile(_passwordFile.getName(), ".tmp");
 
             try
             {



Mime
View raw message