|
@@ -7,6 +7,8 @@ import java.util.ArrayList;
|
7
|
7
|
|
8
|
8
|
public class Main {
|
9
|
9
|
|
|
10
|
+ static ItemList itemList = new ItemList();
|
|
11
|
+
|
10
|
12
|
public ArrayList<String> readRawDataToString() throws Exception {
|
11
|
13
|
ClassLoader classLoader = getClass().getClassLoader();
|
12
|
14
|
String result = IOUtils.toString(classLoader.getResourceAsStream("RawData.txt"));
|
|
@@ -19,10 +21,10 @@ public class Main {
|
19
|
21
|
public static void main(String[] args) throws Exception {
|
20
|
22
|
ArrayList<String> output = (new Main()).readRawDataToString();
|
21
|
23
|
ItemParser itemParser = new ItemParser();
|
22
|
|
- ArrayList<String> lastArray = itemParser.findKeyValuePairsInRawItemData(output.toString());
|
23
|
|
- for (String s : lastArray) {
|
|
24
|
+ for (String s : output) {
|
24
|
25
|
try{
|
25
|
|
- Item item = itemParser.parseStringIntoItem(s);
|
|
26
|
+ itemParser.parseStringIntoItem(s);
|
|
27
|
+
|
26
|
28
|
|
27
|
29
|
} catch (ItemParseException e) {
|
28
|
30
|
continue;
|