[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKDESC-18) import should close stream

Andrew Rubinger (JIRA) jira-events at lists.jboss.org
Thu Jul 21 17:35:23 EDT 2011


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

Andrew Rubinger commented on SHRINKDESC-18:
-------------------------------------------

This breaks the symmetry; whomever opened the stream should in general close it.  But I see the value in saving our users the boilerplate when they typically just want to read in the contents.  So let's instead add this in DescriptorImporter:

T from(InputStream in, boolean close);

We'll overload it.  The close flag set to false will keep it open so the user may reset and reuse (if the stream supports it).  In the single-argument version, we'll default to closing the stream.  And both methods should be documented to make clear what we're doing.

Keep in mind the SPI has been refactored, so new patches should take that into account.

> import should close stream
> --------------------------
>
>                 Key: SHRINKDESC-18
>                 URL: https://issues.jboss.org/browse/SHRINKDESC-18
>             Project: ShrinkWrap Descriptors
>          Issue Type: Feature Request
>          Components: api
>    Affects Versions: 0.1.0
>            Reporter: Dan Allen
>            Priority: Minor
>
> The import process should close the stream. After all, the main purpose of providing the stream is to slurp up all the contents. If the stream is left open, we throw the burden back on the developer to close it (and all the try/catch block headaches)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list