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

Add hints for when File.listFiles() returns null

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              rh-ee-galder Galder ZamarreƱo
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: