Revision 58383
Added by Andreas Czerniak almost 4 years ago
RestIterator.java | ||
---|---|---|
203 | 203 |
URL qUrl = new URL(query); |
204 | 204 |
|
205 | 205 |
if (this.authMethod == "bearer") { |
206 |
log.trace("authMethode before inputStream: " + resultXml); |
|
207 |
|
|
206 | 208 |
HttpURLConnection conn = (HttpURLConnection) qUrl.openConnection(); |
207 | 209 |
conn.setRequestProperty("Authorization","Bearer "+authToken); |
208 | 210 |
conn.setRequestProperty("Content-Type","application/json"); |
... | ... | |
345 | 347 |
jsonInput = jsonInput.replaceAll("\"([^\"]*)[)]([^\"]*)\":", "\"$1$2\":"); |
346 | 348 |
} |
347 | 349 |
|
348 |
// replace startNumbers in JSON Keynames with 'n_'
|
|
350 |
// add prefix of startNumbers in JSON Keynames with 'n_'
|
|
349 | 351 |
while (jsonInput.matches(".*\"([^\"][0-9])([^\"]*)\":.*")) { |
350 | 352 |
jsonInput = jsonInput.replaceAll("\"([^\"][0-9])([^\"]*)\":", "\"n_$1$2\":"); |
351 | 353 |
} |
354 |
// add prefix of only numbers in JSON Keynames with 'm_' |
|
355 |
while (jsonInput.matches(".*\"([0-9]+)\":.*")) { |
|
356 |
jsonInput = jsonInput.replaceAll("\"([0-9]+)\":", "\"m_$1\":"); |
|
357 |
} |
|
352 | 358 |
|
353 | 359 |
// replace ':' between number like '2018-08-28T11:05:00Z' in JSON keynames with '' |
354 | 360 |
while (jsonInput.matches(".*\"([^\"]*[0-9]):([0-9][^\"]*)\":.*")) { |
Also available in: Unified diff
adding loop to clean-up the json format