You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Craig Skinfill (JIRA)" <ji...@apache.org> on 2012/07/11 21:48:33 UTC
[jira] [Created] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Craig Skinfill created VFS-427:
----------------------------------
Summary: NPE on HttpFileObject.getContent().getContentInfo()
Key: VFS-427
URL: https://issues.apache.org/jira/browse/VFS-427
Project: Commons VFS
Issue Type: Bug
Reporter: Craig Skinfill
It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (VFS-427) [HTTP] NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated VFS-427:
--------------------------------
Summary: [HTTP] NPE on HttpFileObject.getContent().getContentInfo() (was: NPE on HttpFileObject.getContent().getContentInfo())
> [HTTP] NPE on HttpFileObject.getContent().getContentInfo()
> ----------------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415397#comment-13415397 ]
Gary D. Gregory commented on VFS-427:
-------------------------------------
Ok, I can reproduce, will fix today or tomorrow...
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412472#comment-13412472 ]
Gary D. Gregory commented on VFS-427:
-------------------------------------
1) You did not reply to which version of VFS you are using.
2) Can you dupliicate this with trunk?
I added another test in trunk: org.apache.commons.vfs2.provider.http.test.HttpProviderTestCase.testGetContentInfo()
I can see where the code might cause an NPE, but I'd like to have a test case in trunk that breaks before I change any code.
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Craig Skinfill (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412494#comment-13412494 ]
Craig Skinfill commented on VFS-427:
------------------------------------
1) I'm using version 2.0 from maven repo.
2) I haven't tried against trunk. I'll try tomorrow.
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411999#comment-13411999 ]
Gary D. Gregory commented on VFS-427:
-------------------------------------
What version are you using?
Please get the latest from trunk and see:
org.apache.commons.vfs2.test.ProviderReadTests.testContentInfo()
Can you reproduce your problems there? Or provide reproducible test case in code?
Thank you,
Gary
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Craig Skinfill (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415374#comment-13415374 ]
Craig Skinfill commented on VFS-427:
------------------------------------
I tried it against trunk, and it still threw the exception if i don't call fo.getType() first.
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415366#comment-13415366 ]
Gary D. Gregory commented on VFS-427:
-------------------------------------
Any more info?
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-427) NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Craig Skinfill (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412015#comment-13412015 ]
Craig Skinfill commented on VFS-427:
------------------------------------
Here's what I'm seeing
FileSystemManager fsManager = VFS.getManager();
FileObject fo = fsManager.resolveFile("http://www.google.com/images/logos/ps_logo2.png");
FileContent content = fo.getContent();
content.getContentInfo();
java.lang.NullPointerException
at org.apache.commons.vfs2.provider.http.HttpFileContentInfoFactory.create(HttpFileContentInfoFactory.java:43)
at org.apache.commons.vfs2.provider.DefaultFileContent.getContentInfo(DefaultFileContent.java:731)
However, it appears to work fine if I put
FileObject fo = fsManager.resolveFile(uri2use);
fo.getType();
FileContent content = fo.getContent();
content.getContentInfo();
or if I do
FileObject fo = fsManager.resolveFile(uri2use);
FileContent content = fo.getContent();
content.getSize();
content.getContentInfo();
In those two cases it works properly (no NPE). Looks like the headMethod in the HttpFileObject needs to be initialized earlier?
> NPE on HttpFileObject.getContent().getContentInfo()
> ---------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (VFS-427) [HTTP] NPE on
HttpFileObject.getContent().getContentInfo()
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory resolved VFS-427.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.1
commit -m "[VFS-427][HTTP] NPE on HttpFileObject.getContent().getContentInfo()." (7 paths specified)
Sending C:/svn/org/apache/commons/trunks-proper/vfs/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java
Sending C:/svn/org/apache/commons/trunks-proper/vfs/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
Adding C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/http/test/GetContentInfoFunctionalTest.java
Adding C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/https
Adding C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/https/test
Adding C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/https/test/GetContentInfoFunctionalTest.java
Sending C:/svn/org/apache/commons/trunks-proper/vfs/src/changes/changes.xml
Transmitting file data ...
Committed revision 1362235.
> [HTTP] NPE on HttpFileObject.getContent().getContentInfo()
> ----------------------------------------------------------
>
> Key: VFS-427
> URL: https://issues.apache.org/jira/browse/VFS-427
> Project: Commons VFS
> Issue Type: Bug
> Reporter: Craig Skinfill
> Fix For: 2.1
>
>
> It looks like the "head" httpMethod is getting set to null, but is used in the getContentInfo() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira