import org.json.JSONObject;
import com.twilio.Twilio;
import com.twilio.rest.video.v1.Recording;


public class Example {
    // Find your Account Sid and Token at twilio.com/console
    public static final String API_KEY_SID = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String API_KEY_SECRET = "your_api_key_secret";

    public static void main(String args[]) {

        // Initialize the client
        Twilio.init(API_KEY_SID, API_KEY_SECRET);

        String roomSid = "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        String recordingSid = "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        TwilioRestClient restClient = Twilio.getRestClient();
        Request request = new Request(
            HttpMethod.POST,
            Domains.VIDEO.toString(),
            "/v1/Rooms/" + roomSid +
            "/Recordings/" + recordingSid +
            "/Media/",
            restClient.getRegion()
        );
        Response response = restClient.request(request);
        String mediaLocation = json.getJSONObject(response.getStream()).getString("location");

        System.out.println(mediaLocation);
    }
}

@@ -4,468 +4,1120 @@
 ort 
-org.json.JSONObject;%0Aimport com.twilio.Twilio;%0Aimport com.twilio.rest.video.v1.Recording;%0A%0A%0Apublic class Example %7B%0A    // Find your Account Sid and Token at twilio.com/console%0A    public static final String API_KEY_SID = %22SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%22;%0A    public static final String API_KEY_SECRET = %22your_api_key_secret%22;%0A%0A    public static void main(String args%5B%5D) %7B%0A%0A        // Initialize the client%0A        Twilio.init(API_KEY_SID, API_KEY_SECRET);%0A
+com.twilio.http.HttpMethod;%0Aimport com.twilio.http.NetworkHttpClient;%0Aimport com.twilio.http.Request;%0Aimport com.twilio.http.Response;%0Aimport com.twilio.http.TwilioRestClient;%0Aimport com.twilio.rest.Domains;%0Aimport org.apache.commons.io.IOUtils;%0Aimport org.apache.http.impl.client.HttpClientBuilder;%0Aimport org.json.JSONObject;%0A%0Aimport java.io.IOException;%0A%0A%0Apublic class Example %7B%0A    // Find your Account Sid and Token at twilio.com/console%0A    public static final String API_KEY_SID = %22SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%22;%0A    public static final String API_KEY_SECRET = %22your_api_key_secret%22;%0A%0A    public static void main(String args%5B%5D) throws IOException %7B%0A        // Disable HttpClient follow redirect by default%0A        HttpClientBuilder clientBuilder = HttpClientBuilder.create();%0A        clientBuilder.disableRedirectHandling();%0A%0A        // Initialize the client%0A        TwilioRestClient restClient = new TwilioRestClient%0A                .Builder(API_KEY_SID, API_KEY_SECRET)%0A                .httpClient(new NetworkHttpClient(clientBuilder))%0A                .build();%0A%0A        // Retrieve media location
 %0A   
@@ -1245,70 +1245,8 @@
 X%22;%0A
-        TwilioRestClient restClient = Twilio.getRestClient();%0A
     
@@ -1307,11 +1307,10 @@
 hod.
-POS
+GE
 T,%0A 
@@ -1565,92 +1565,400 @@
     
-String mediaLocation = json.getJSONObject(response.getStream()).getString(%22location%22
+JSONObject json = new JSONObject(response.getContent());%0A        String mediaLocation = json.getString(%22redirect_to%22);%0A%0A        // Retrieve media content%0A        String mediaContent = org.apache.http.client.fluent.Request%0A                .Get(mediaLocation)%0A                .execute()%0A                .handleResponse((r) -%3E%0A                        IOUtils.toString(r.getEntity().getContent())
 );%0A%0A
@@ -1989,24 +1989,23 @@
 ln(media
-Location
+Content
 );%0A    %7D

Fix Java room recording media snippet