Commit 419d9682300bece96e1072f7443e33e0f8fa8864
1 parent
65b52d88
Exists in
master
and in
1 other branch
Remove JSON related function
Showing
2 changed files
with
0 additions
and
32 deletions
Show diff stats
pom.xml
... | ... | @@ -173,13 +173,6 @@ |
173 | 173 | |
174 | 174 | <!-- The project dependencies --> |
175 | 175 | <dependencies> |
176 | - <!-- A library to deal with JSON files --> | |
177 | - <dependency> | |
178 | - <groupId>org.json</groupId> | |
179 | - <artifactId>json</artifactId> | |
180 | - <version>20190722</version> | |
181 | - </dependency> | |
182 | - | |
183 | 176 | <!-- Needed to compile with Java 11+ as removed from Java --> |
184 | 177 | <dependency> |
185 | 178 | <groupId>javax.xml.bind</groupId> | ... | ... |
src/main/java/eu/omp/irap/vespa/votable/utils/Network.java
... | ... | @@ -30,8 +30,6 @@ import java.util.Map; |
30 | 30 | import java.util.logging.Level; |
31 | 31 | import java.util.logging.Logger; |
32 | 32 | |
33 | -import org.json.JSONObject; | |
34 | - | |
35 | 33 | import eu.omp.irap.vespa.votable.Consts; |
36 | 34 | |
37 | 35 | /** |
... | ... | @@ -75,29 +73,6 @@ public class Network { |
75 | 73 | } |
76 | 74 | |
77 | 75 | /** |
78 | - * Send a request, download the returned JSon file, then parse it and returns the corresponding | |
79 | - * JSon object. | |
80 | - * | |
81 | - * @param request The request sent to get the JSon file. | |
82 | - * @return The JSon object corresponding to the JSon text returned by the query. | |
83 | - * @throws CantSendQueryException The query can not be sent. | |
84 | - */ | |
85 | - public static JSONObject readJson(String request) throws CantSendQueryException { | |
86 | - try (BufferedReader reader = new BufferedReader( | |
87 | - new InputStreamReader(new URL(request).openStream()))) { | |
88 | - StringBuilder buffer = new StringBuilder(); | |
89 | - int read; | |
90 | - char[] chars = new char[1024]; | |
91 | - while ((read = reader.read(chars)) != -1) { | |
92 | - buffer.append(chars, 0, read); | |
93 | - } | |
94 | - return new JSONObject(buffer.toString()); | |
95 | - } catch (IOException e) { | |
96 | - throw new CantSendQueryException("Can not send the Json query " + request, e); | |
97 | - } | |
98 | - } | |
99 | - | |
100 | - /** | |
101 | 76 | * Send a query and save the result in a temporary file wirh prefix epnTapLib_and extension .xml |
102 | 77 | * |
103 | 78 | * @param url The URL of the query | ... | ... |