Commits

Anonymous committed 0787067

XW-700 DefaultValidatorFactory throws exception

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1994e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java

                         // and match the filenames with *-validators.xml. If the filename
                         // matches then add to the list of files to be parsed
                         if (f.isDirectory()) {
-                            files.addAll(Arrays.asList(f.listFiles(filter)));
+                            try {
+                                File[] ff = f.listFiles(filter);
+                                if ( ff != null && ff.length > 0) {
+                                    files.addAll(Arrays.asList(ff));
+                                }
+                            } catch (SecurityException se) {
+                                LOG.error("Security Exception while accessing directory '" + f + "'", se);
+                            }
+
                         } else {
                             // If this is not a directory, then get hold of the inputstream.
                             // If its not a ZipInputStream, then create a ZipInputStream out