4124 |
23 Sep 16 |
nicklas |
1 |
package net.sf.basedb.opengrid.filetransfer; |
4124 |
23 Sep 16 |
nicklas |
2 |
|
4124 |
23 Sep 16 |
nicklas |
3 |
import java.io.OutputStream; |
4124 |
23 Sep 16 |
nicklas |
4 |
|
4124 |
23 Sep 16 |
nicklas |
5 |
/** |
4124 |
23 Sep 16 |
nicklas |
Generic download target implementation that simply wraps an |
4124 |
23 Sep 16 |
nicklas |
existing output stream. File metadata about the remote file |
4124 |
23 Sep 16 |
nicklas |
will be collected by the {@link #getMetadata()} instance. |
4124 |
23 Sep 16 |
nicklas |
9 |
|
4124 |
23 Sep 16 |
nicklas |
@author nicklas |
4124 |
23 Sep 16 |
nicklas |
@since 1.0 |
4124 |
23 Sep 16 |
nicklas |
12 |
*/ |
4124 |
23 Sep 16 |
nicklas |
13 |
public class OutputStreamDownloadTarget |
4124 |
23 Sep 16 |
nicklas |
14 |
extends AbstractFileTransfer |
4124 |
23 Sep 16 |
nicklas |
15 |
implements DownloadTarget |
4124 |
23 Sep 16 |
nicklas |
16 |
{ |
4124 |
23 Sep 16 |
nicklas |
17 |
|
4124 |
23 Sep 16 |
nicklas |
18 |
private final OutputStream out; |
4124 |
23 Sep 16 |
nicklas |
19 |
|
4124 |
23 Sep 16 |
nicklas |
20 |
public OutputStreamDownloadTarget(String name, OutputStream out) |
4124 |
23 Sep 16 |
nicklas |
21 |
{ |
4124 |
23 Sep 16 |
nicklas |
22 |
super(name); |
4124 |
23 Sep 16 |
nicklas |
23 |
this.out = out; |
4124 |
23 Sep 16 |
nicklas |
24 |
} |
4124 |
23 Sep 16 |
nicklas |
25 |
|
4124 |
23 Sep 16 |
nicklas |
26 |
@Override |
4124 |
23 Sep 16 |
nicklas |
27 |
public OutputStream getOutputStream() |
4124 |
23 Sep 16 |
nicklas |
28 |
{ |
4124 |
23 Sep 16 |
nicklas |
29 |
return out; |
4124 |
23 Sep 16 |
nicklas |
30 |
} |
4124 |
23 Sep 16 |
nicklas |
31 |
|
4124 |
23 Sep 16 |
nicklas |
32 |
} |