static String[] safelyFindFiles(final File directory, final Pattern p) {
        String[] rc = null;

        try {
            rc = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<String[]>() {
                @Override
                public String[] run() throws Exception {
                    return directory.list(new LoggingFileUtils.RegexFilenameFilter(p));
                }
            });
        } catch (Exception ex) {
            // No FFDC code needed
        }

        return rc;
    }
static String [ ] safelyFindFiles ( final File directory , final Pattern p ) { String [ ] rc = null ; try { rc = AccessController . doPrivileged ( new java . security . PrivilegedExceptionAction < String [ ] > ( ) { @ Override public String [ ] run ( ) throws Exception { return directory . list ( new LoggingFileUtils . RegexFilenameFilter ( p ) ) ; } } ) ; } catch ( Exception ex ) { } return rc ; }
Safely retrieve a list of files from the given directory:
filter the files using the specified regular expression

@param dirName Directory to list
@param p Regex pattern that should be used to filter listed files
@return String array containing files matching the pattern, or null