[gatein-issues] [JBoss JIRA] (GTNPORTAL-2722) Improve design of DownloadResource

Minh Hoang TO (JIRA) jira-events at lists.jboss.org
Tue Jan 15 04:26:21 EST 2013


     [ https://issues.jboss.org/browse/GTNPORTAL-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Minh Hoang TO updated GTNPORTAL-2722:
-------------------------------------

              Status: Pull Request Sent  (was: Open)
    Git Pull Request: https://github.com/gatein/gatein-portal/pull/317

    
> Improve design of DownloadResource
> ----------------------------------
>
>                 Key: GTNPORTAL-2722
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-2722
>             Project: GateIn Portal
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>            Reporter: Minh Hoang TO
>
> For the moment, DownloadResource is designed as a wrapper of InputStream.
> {code:java}
> public abstract class DownloadResource
> {
>   public abstract InputStream getInputStream() throws IOException;
> }
> {code}
> This design is bad as the code of DownloadService has to care about IO handling on DownloadResource. That work should be done on DownloadResource creator 's side.
> It is better with
> {code:java}
> public abstract class DownloadResource
> {
>   public abstract void write(OutputStream out) throws IOException;
> }
> {code}

--
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 gatein-issues mailing list