|
1 | | -package com.codingchili.Model; |
2 | | - |
3 | | -import io.vertx.core.json.JsonObject; |
4 | | -import org.reactivestreams.Publisher; |
5 | | - |
6 | | -import java.io.FileNotFoundException; |
7 | | -import java.util.Set; |
8 | | - |
9 | | -/** |
10 | | - * @author Robin Duda |
11 | | - * <p> |
12 | | - * Interface used to support different input file formats. |
13 | | - * The parser is subscribable and emits json objects for importing. |
14 | | - */ |
15 | | -public interface FileParser extends Publisher<JsonObject> { |
16 | | - |
17 | | - /** |
18 | | - * @param localFileName a file on disk to be parsed, do not read this into memory |
19 | | - * as it could be potentially very large. |
20 | | - * @param offset indicates how many empty rows to skip before finding the titles. |
21 | | - * @param fileName the original name of the file to be imported. |
22 | | - */ |
23 | | - void setFileData(String localFileName, int offset, String fileName) throws FileNotFoundException; |
24 | | - |
25 | | - /** |
26 | | - * @return a set of file extensions that this fileparser supports. |
27 | | - */ |
28 | | - Set<String> getSupportedFileExtensions(); |
29 | | - |
30 | | - /** |
31 | | - * Parses the excel file to make sure that it is parseable without allocating memory |
32 | | - * for the result. This should be called before importing to make |
33 | | - * sure any imports does not fail halfway through. |
34 | | - */ |
35 | | - void initialize(); |
36 | | - |
37 | | - /** |
38 | | - * @return the number of elements that was parsed. |
39 | | - */ |
40 | | - int getNumberOfElements(); |
41 | | - |
42 | | - |
43 | | - /** |
44 | | - * Releases any resources associated with the FileParser. |
45 | | - */ |
46 | | - void free(); |
47 | | -} |
| 1 | +package com.codingchili.Model; |
| 2 | + |
| 3 | +import io.vertx.core.json.JsonObject; |
| 4 | +import org.reactivestreams.Publisher; |
| 5 | + |
| 6 | +import java.io.FileNotFoundException; |
| 7 | +import java.util.Set; |
| 8 | + |
| 9 | +/** |
| 10 | + * @author Robin Duda |
| 11 | + * <p> |
| 12 | + * Interface used to support different input file formats. |
| 13 | + * The parser is subscribable and emits json objects for importing. |
| 14 | + */ |
| 15 | +public interface FileParser extends Publisher<JsonObject> { |
| 16 | + |
| 17 | + /** |
| 18 | + * @param localFileName a file on disk to be parsed, do not read this into memory |
| 19 | + * as it could be potentially very large. |
| 20 | + * @param offset indicates how many empty rows to skip before finding the titles. |
| 21 | + * @param fileName the original name of the file to be imported. |
| 22 | + */ |
| 23 | + void setFileData(String localFileName, int offset, String fileName) throws FileNotFoundException; |
| 24 | + |
| 25 | + /** |
| 26 | + * @return a set of file extensions that this fileparser supports. |
| 27 | + */ |
| 28 | + Set<String> getSupportedFileExtensions(); |
| 29 | + |
| 30 | + /** |
| 31 | + * Parses the excel file to make sure that it is parseable without allocating memory |
| 32 | + * for the result. This should be called before importing to make |
| 33 | + * sure any imports does not fail halfway through. |
| 34 | + */ |
| 35 | + void initialize(); |
| 36 | + |
| 37 | + /** |
| 38 | + * @return the number of elements that was parsed. |
| 39 | + */ |
| 40 | + int getNumberOfElements(); |
| 41 | + |
| 42 | + |
| 43 | + /** |
| 44 | + * Releases any resources associated with the FileParser. |
| 45 | + */ |
| 46 | + void free(); |
| 47 | +} |
0 commit comments