[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-448) Using asSingleFile only works if you return a single file

Tommy Tynjä (JIRA) jira-events at lists.jboss.org
Thu Apr 18 08:16:55 EDT 2013


    [ https://issues.jboss.org/browse/SHRINKWRAP-448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768458#comment-12768458 ] 

Tommy Tynjä commented on SHRINKWRAP-448:
----------------------------------------

I think asSingleFile has value over asFile()[0]. Think of the method asSingleFile like getSingleResult in JPA. When you are using that method you are expecting one result and one result only. If you would receive multiple results it's an error. It should not just default to the first result, in that case you are better of with asFile()[0] or something like a getFirstFile method.
                
> Using asSingleFile only works if you return a single file
> ---------------------------------------------------------
>
>                 Key: SHRINKWRAP-448
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-448
>             Project: ShrinkWrap
>          Issue Type: Feature Request
>            Reporter: John Ament
>
> In this code example
> return Maven.resolver().offline().loadPomFromFile("pom.xml")
>                 .resolve(artifact)
>                 .withTransitivity().asFile()[0];
> You should be able to replace asFile()[0] with asSingleFile, however it doesn't work since multiple files are actually returned.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the shrinkwrap-issues mailing list