title: File.listFiles() does not work on Linux
body: <p>Ok. I have the following web app snippet (called in constructor - if that is important):</p>
  
  <pre><code>    private File[] logFiles;
      ...
      try {
          File directory = new File(auditDirectory);
          LOG.debug("Found directory: " + directory.getAbsolutePath());
          logFiles = directory.listFiles();           
          LOG.debug("Number of logFiles: " + logFiles.length);
      } catch (Exception e) {
          LOG.error("Exception: ", e);
          throw new RuntimeException("Failed to get list of audit files", e);
      }
  </code></pre>
  
  <p>In my windows environment (localhost) everything works like a charm. After deployment on linux (ubuntu) environment, seems that line</p>
  
  <pre><code>directory.listFiles();
  </code></pre>
  
  <p>returns null value. I have concluded that from the following linux deployment log:</p>
  
  <pre><code>c.a.s.a.a.AuditFileSource - Found directory: /home/myapp/myappfolder/logs
  c.a.s.a.a.AuditFileSource - Exception: 
  java.lang.NullPointerException: null
      at com.myapp.services.administration.audit.AuditFileSource.&lt;init&gt;(AuditFileSource.java:31) ~[com.myapp.services-2.2.2.jar:2.2.2]
      at... 
  </code></pre>
  
  <p>Log line AuditFileSource.java:31 is actually the line:</p>
  
  <pre><code>LOG.debug("Number of logFiles: " + logFiles.length);
  </code></pre>
  
  <p>and it is obvious that NullPointerException is raised as an attempt to access lenght on logFiles variable which is null. </p>
  
  <p>My first try was to change permissions on relevant Linux folders but they already have read permissions. I'm completely puzzled. Any Idea? </p>