commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Skinfill (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (VFS-427) NPE on HttpFileObject.getContent().getContentInfo()
Date Wed, 11 Jul 2012 21:29:35 GMT

    [ 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

        

Mime
View raw message