summaryrefslogtreecommitdiff
path: root/java/broker/src
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-06-18 10:49:50 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-06-18 10:49:50 +0000
commitc41d9e7d947bcf5b313626184b7cb2eba5754a55 (patch)
tree3fdf317442269f8ea46a7e7d86235d1b76e3bc6f /java/broker/src
parenta6e6a26fece3dcea4251607e28f09cced880698d (diff)
downloadqpid-python-c41d9e7d947bcf5b313626184b7cb2eba5754a55.tar.gz
Various License header updates.
Update to PrincipalDatabase's to ensure they work correctly with # comments. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@548302 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java15
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java8
2 files changed, 11 insertions, 12 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java b/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
index c49f4e2a33..b29ea66bfc 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
@@ -29,18 +29,17 @@ import org.apache.qpid.server.security.auth.sasl.plain.PlainInitialiser;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.login.AccountNotFoundException;
+import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.BufferedReader;
import java.io.FileReader;
-import java.io.UnsupportedEncodingException;
-import java.util.regex.Pattern;
-import java.util.Map;
+import java.io.IOException;
+import java.security.Principal;
import java.util.HashMap;
-import java.util.List;
import java.util.LinkedList;
-import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
/**
* Represents a user database where the account information is stored in a simple flat file.
@@ -212,7 +211,7 @@ public class PlainPasswordFilePrincipalDatabase implements PrincipalDatabase
reader = new BufferedReader(new FileReader(_passwordFile));
String line;
- while ((line = reader.readLine()) != null)
+ while ((line = reader.readLine()) != null && !line.startsWith("#"))
{
String[] result = _regexp.split(line);
if (result == null || result.length < 2)
diff --git a/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java b/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java
index 598f8f8b4c..f4f3385c75 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java
@@ -20,17 +20,17 @@
*/
package org.apache.qpid.server.security.auth.database;
+import org.apache.log4j.Logger;
import org.apache.qpid.server.security.access.AccessManager;
import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.Accessable;
import org.apache.qpid.server.security.access.AccessRights;
+import org.apache.qpid.server.security.access.Accessable;
import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.log4j.Logger;
-import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
+import java.io.IOException;
import java.security.Principal;
/**
@@ -61,7 +61,7 @@ public class PlainPasswordVhostFilePrincipalDatabase extends PlainPasswordFilePr
reader = new BufferedReader(new FileReader(_passwordFile));
String line;
- while ((line = reader.readLine()) != null)
+ while ((line = reader.readLine()) != null && !line.startsWith("#"))
{
String[] result = _regexp.split(line);
if (result == null || result.length < 3)