[jira] [Commented] (IO-480) IOUtils.closeQuietly can throw NullPointerException

2016-07-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/IO-480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15390241#comment-15390241
 ] 

ASF GitHub Bot commented on IO-480:
---

Github user rajivpjs closed the pull request at:

https://github.com/apache/commons-io/pull/14


> IOUtils.closeQuietly can throw NullPointerException
> ---
>
> Key: IO-480
> URL: https://issues.apache.org/jira/browse/IO-480
> Project: Commons IO
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.4
>Reporter: Matt Kusnierz
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The IOUtils#closeQuietly method in its javadoc suggests that ANY exceptions 
> will be ignored. This is not the case, as the code only catches IOExceptions. 
> As this example stack trace shows, it is possible for some InputStreams to 
> throw NullPointerExceptions during close:
> java.lang.NullPointerException: null
>   at java.io.FilterInputStream.close(FilterInputStream.java:155) 
> ~[na:1.6.0_35]
>   at 
> sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close(JarURLConnection.java:90)
>  ~[na:1.6.0_35]
>   at org.apache.commons.io.IOUtils.closeQuietly(IOUtils.java:281) 
> ~[commons-io-2.1.jar:2.1]
>   at org.apache.commons.io.IOUtils.closeQuietly(IOUtils.java:224) 
> ~[commons-io-2.1.jar:2.1]
> Close quietly should do as advertised/suggested and catch all Exceptions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (VFS-617) isReadable fails if unable to determine group identity

2016-07-22 Thread Joshua Woods (JIRA)

[ 
https://issues.apache.org/jira/browse/VFS-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15389884#comment-15389884
 ] 

Joshua Woods commented on VFS-617:
--

Hi,

I'm not very familiar with the code, but in SftpFileSystem::getGroupsIds, 
shouldn't the command-line call "id -G" normally return non-zero's when it 
finds group ID's?  The exception is being thrown when the id is non-zero.  Hope 
this helps!

Thanks,
Josh

> isReadable fails if unable to determine group identity
> --
>
> Key: VFS-617
> URL: https://issues.apache.org/jira/browse/VFS-617
> Project: Commons VFS
>  Issue Type: Bug
>Affects Versions: 2.1
> Environment: Windows 7 Java 7. Failure occured connecting via SFTP to 
> a Synology box running DSM 6.
>Reporter: Tim Nickels
>
> The doIsReadable method of SftpFileObject throws an exception if the system 
> cannot identify group/owner permissions... 
> Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Could 
> not determine if file "sftp://myURI"; is readable.
>   at 
> org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1761)
>   at com.avenca.vfs.VFSUtils.main(VFSUtils.java:41)
> Caused by: com.jcraft.jsch.JSchException: Could not get the groups id of the 
> current user (error code: 1)
>   at 
> org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getGroupsIds(SftpFileSystem.java:263)
>   at 
> org.apache.commons.vfs2.provider.sftp.SftpFileObject.getPermissions(SftpFileObject.java:317)
>   at 
> org.apache.commons.vfs2.provider.sftp.SftpFileObject.doIsReadable(SftpFileObject.java:335)
>   at 
> org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1757)
> The problem is the method is using 
> return getPermissions(true).isReadable()
> The folder *is* readable without these permissions, and so should be set to
> return getPermissions(false).isReadable()
> Which correctly allows the system to identify a readable folder without 
> adding unnecessary restrictions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)