1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
package org.apache.commons.classscan.builtin; |
15 | |
|
16 | |
import java.io.BufferedInputStream; |
17 | |
import java.io.File; |
18 | |
import java.io.FileInputStream; |
19 | |
import java.io.IOException; |
20 | |
import java.io.InputStream; |
21 | |
|
22 | |
import org.apache.commons.classscan.ResourceFile; |
23 | |
|
24 | |
public class FileResourceFile implements ResourceFile { |
25 | |
|
26 | |
private final File location; |
27 | |
private final String relativePath; |
28 | |
|
29 | 0 | public FileResourceFile(File location, String relativePath) { |
30 | 0 | this.location = location; |
31 | 0 | this.relativePath = relativePath; |
32 | 0 | } |
33 | |
|
34 | |
@Override |
35 | |
public String getFileName() { |
36 | 0 | return relativePath; |
37 | |
} |
38 | |
|
39 | |
@Override |
40 | |
public InputStream getBytes() throws IOException { |
41 | 0 | return new BufferedInputStream(new FileInputStream(location)); |
42 | |
} |
43 | |
} |