4123 |
22 Sep 16 |
nicklas |
1 |
package net.sf.basedb.opengrid.filetransfer; |
4123 |
22 Sep 16 |
nicklas |
2 |
|
4123 |
22 Sep 16 |
nicklas |
3 |
import java.io.OutputStream; |
4123 |
22 Sep 16 |
nicklas |
4 |
|
4123 |
22 Sep 16 |
nicklas |
5 |
import net.sf.basedb.core.File; |
4123 |
22 Sep 16 |
nicklas |
6 |
|
4123 |
22 Sep 16 |
nicklas |
7 |
/** |
4123 |
22 Sep 16 |
nicklas |
Download target implementation for storing a file from a |
4123 |
22 Sep 16 |
nicklas |
remote server to the BASE filesystem. |
4123 |
22 Sep 16 |
nicklas |
10 |
|
4123 |
22 Sep 16 |
nicklas |
@author nicklas |
4123 |
22 Sep 16 |
nicklas |
@since 1.0 |
4123 |
22 Sep 16 |
nicklas |
13 |
*/ |
4123 |
22 Sep 16 |
nicklas |
14 |
public class BaseFileDownloadTarget |
4124 |
23 Sep 16 |
nicklas |
15 |
extends AbstractFileTransfer |
4124 |
23 Sep 16 |
nicklas |
16 |
implements DownloadTarget |
4123 |
22 Sep 16 |
nicklas |
17 |
{ |
4123 |
22 Sep 16 |
nicklas |
18 |
|
4123 |
22 Sep 16 |
nicklas |
19 |
private final File file; |
4123 |
22 Sep 16 |
nicklas |
20 |
|
4123 |
22 Sep 16 |
nicklas |
21 |
/** |
4123 |
22 Sep 16 |
nicklas |
Create a new download target that references the |
4123 |
22 Sep 16 |
nicklas |
given file in BASE. |
4123 |
22 Sep 16 |
nicklas |
24 |
*/ |
4123 |
22 Sep 16 |
nicklas |
25 |
public BaseFileDownloadTarget(File file) |
4123 |
22 Sep 16 |
nicklas |
26 |
{ |
4123 |
22 Sep 16 |
nicklas |
27 |
super(file.getName()); |
4123 |
22 Sep 16 |
nicklas |
28 |
this.file = file; |
4123 |
22 Sep 16 |
nicklas |
29 |
} |
4123 |
22 Sep 16 |
nicklas |
30 |
|
4123 |
22 Sep 16 |
nicklas |
31 |
@Override |
4123 |
22 Sep 16 |
nicklas |
32 |
public OutputStream getOutputStream() |
4123 |
22 Sep 16 |
nicklas |
33 |
{ |
4123 |
22 Sep 16 |
nicklas |
34 |
return file.getUploadStream(false); |
4123 |
22 Sep 16 |
nicklas |
35 |
} |
4123 |
22 Sep 16 |
nicklas |
36 |
|
4123 |
22 Sep 16 |
nicklas |
37 |
} |