Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1914

Add hints for when File.listFiles() returns null

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Under some circumstances, File.listFiles() can return null as shown by AS7-3808:

      @return  An array of abstract pathnames denoting the files and
               directories in the directory denoted by this abstract
               pathname.  The array will be empty if the directory is
               empty.  Returns <code>null</code> if this abstract pathname
               does not denote a directory, or if an I/O error occurs.
      

      In order to get more information, if listFiles() returns null, add some checks to see if File.exists() and if File.isDirectory(). This might give us more of a clue of what happened. Also, although not likely, it might be worth to check permissions via File.canRead() and File.canWrite() too.

              rh-ee-galder Galder ZamarreƱo
              rh-ee-galder Galder ZamarreƱo
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: