1 package rydeen.io;
2
3 import java.io.File;
4 import java.io.FileInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
7
8 import rydeen.ProcessTarget;
9 import rydeen.TargetSource;
10 import rydeen.TargetType;
11
12
13
14
15
16
17 public class FileProcessTarget extends AbstractProcessTarget{
18 private String name;
19 private File file;
20
21
22
23
24
25
26
27
28
29
30 public FileProcessTarget(TargetSource source, String name, File file){
31 super(source, name);
32 this.name = name;
33 this.file = file;
34 }
35
36
37
38
39
40
41
42
43
44
45 public FileProcessTarget(TargetSource source, File file){
46 this(source, file.getName(), file);
47 }
48
49 @Override
50 public String getName(){
51 return name;
52 }
53
54 @Override
55 public InputStream openStream() throws IOException{
56 return new FileInputStream(file);
57 }
58 }