java-raw: inner

This commit is contained in:
vanyauhalin
2023-07-26 11:27:06 +04:00
committed by Sergey Linnik
parent f6e04d5ab9
commit c4de5afd4b

View File

@ -137,10 +137,24 @@ public final class TrackManager {
return body;
}
public static JSONObject resolveProcessSaveBody(final JSONObject body) {
JSONObject copied = body;
String url = (String) copied.get("url");
copied.put("url", url.replace("localhost", "proxy"));
String changesURL = (String) copied.get("changesurl");
copied.put("changesurl", changesURL.replace("localhost", "proxy"));
return copied;
}
// file saving process
public static void processSave(final JSONObject body,
public static void processSave(final JSONObject rawBody,
final String fileName,
final String userAddress) throws Exception {
JSONObject body = TrackManager.resolveProcessSaveBody(rawBody);
if (body.get("url") == null) {
throw new Exception("DownloadUrl is null");
}