[infinispan-issues] [JBoss JIRA] (ISPN-1914) Add hints for when File.listFiles() returns null
Galder Zamarreño (JIRA)
jira-events at lists.jboss.org
Thu Mar 15 08:05:47 EDT 2012
Galder Zamarreño created ISPN-1914:
--------------------------------------
Summary: 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.x, 5.2.0.ALPHA1, 5.2.0.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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list