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

Minh Hoang TO (JIRA) jira-events at lists.jboss.org
Fri Nov 16 03:15:22 EST 2012


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

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

    Description: 
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}


    
> 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