[jboss-cvs] JBossAS SVN: r111414 - projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/security.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 20 15:32:03 EDT 2011


Author: jesper.pedersen
Date: 2011-05-20 15:32:02 -0400 (Fri, 20 May 2011)
New Revision: 111414

Modified:
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java
Log:
Always check if the file is there

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	2011-05-20 16:39:23 UTC (rev 111413)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	2011-05-20 19:32:02 UTC (rev 111414)
@@ -24,6 +24,7 @@
 
 import org.jboss.jca.core.spi.security.Callback;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -179,12 +180,18 @@
       {
          if (usersProperties != null)
          {
-            if (trace)
-               log.trace("users.properties: Using file: " + usersProperties);
+            File f = new File(usersProperties);
 
-            is = new FileInputStream(usersProperties);
+            if (f.exists())
+            {
+               if (trace)
+                  log.trace("users.properties: Using file: " + usersProperties);
+
+               is = new FileInputStream(f);
+            }
          }
-         else
+
+         if (is == null)
          {
             if (trace)
                log.trace("users.properties: Using classloader");
@@ -241,16 +248,24 @@
          }
       }
 
+      is = null;
+
       try
       {
          if (rolesProperties != null)
          {
-            if (trace)
-               log.trace("roles.properties: Using file: " + rolesProperties);
+            File f = new File(rolesProperties);
 
-            is = new FileInputStream(rolesProperties);
+            if (f.exists())
+            {
+               if (trace)
+                  log.trace("roles.properties: Using file: " + rolesProperties);
+
+               is = new FileInputStream(f);
+            }
          }
-         else
+
+         if (is == null)
          {
             if (trace)
                log.trace("roles.properties: Using classloader");



More information about the jboss-cvs-commits mailing list