]
Sanne Grinovero updated ISPN-1914:
----------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
Add hints for when File.listFiles() returns null
------------------------------------------------
Key: ISPN-1914
URL:
https://issues.jboss.org/browse/ISPN-1914
Project: Infinispan
Issue Type: Enhancement
Components: Loaders and Stores
Affects Versions: 5.1.2.FINAL
Reporter: Galder ZamarreƱo
Assignee: Galder ZamarreƱo
Fix For: 5.1.3.CR1, 5.1.3.FINAL
Under some circumstances, File.listFiles() can return null as shown by AS7-3808:
{code}
@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.
{code}
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: