-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDataProcess.java
More file actions
26 lines (19 loc) · 789 Bytes
/
Copy pathDataProcess.java
File metadata and controls
26 lines (19 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.linsir;
import java.io.IOException;
import java.util.HashMap;
public class DataProcess {
public static HashMap<String, String> getData() throws IOException {
String material = NetWorkUtil.getURLResponse(Constant.BASE_URL);
material= material.toLowerCase();
material = material.replaceAll("\\r","");
material = material.replaceAll("\\n","");
String[] materials = material.split(";");
HashMap<String, String> data = new HashMap<>();
for (int i = 0; i < materials.length; i++) {
for (int j = 0; j < materials[i].split("-")[0].split(",").length; j++) {
data.put(materials[i].split("-")[0].split(",")[j], materials[i].split("-")[1]);
}
}
return data;
}
}