1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.tuigwaa.database.util;
17
18 import java.io.InputStream;
19
20 import org.apache.commons.io.IOUtils;
21
22 /***
23 * @author someda
24 */
25 public abstract class DatafileLoader {
26
27 protected InputStream inputStream;
28
29 public DatafileLoader(){
30 }
31
32 public DatafileLoader(InputStream inputStream){
33 this.inputStream = inputStream;
34 }
35
36 /***
37 * Load data and returns its content as string array,
38 * delimitting rule is determined by its concrete class.
39 * Return null at EOF.
40 */
41 public abstract String[] load();
42
43 public void close(){
44 IOUtils.closeQuietly(inputStream);
45 }
46
47 }