APIs to connect to Dispatcher and Extract information | Adobe Higher Education
Skip to main content
Level 2
October 16, 2015
해결됨

APIs to connect to Dispatcher and Extract information

  • October 16, 2015
  • 1 답변
  • 581 조회

Hi All,

Are there any APIs to connect to dispatchers and get cached files pro-grammatically.We want to get basically json files and process them.

Please help  me if anyone is already done the similar kind of implementations and share your experience.

Thanks,

GK

이 주제는 답변이 닫혔습니다.
최고의 답변: Sham_HC

Dispatcher is just a proxy. Use any http client or url connection to connect to webserver and get data.

http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html

import java.net.*;
import java.io.*;

public class URLConnectionReader {
    public static void main(String[] args) throws Exception {
        URL oracle = new URL("http://localhost:4503/content/geometrixx-outdoors/en.json");
        URLConnection yc = oracle.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(
                                    yc.getInputStream()));
        String inputLine;
        while ((inputLine = in.readLine()) != null)
            System.out.println(inputLine);
        in.close();
    }
}

1 답변

Sham_HC
Sham_HC답변
Level 10
October 16, 2015

Dispatcher is just a proxy. Use any http client or url connection to connect to webserver and get data.

http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html

import java.net.*;
import java.io.*;

public class URLConnectionReader {
    public static void main(String[] args) throws Exception {
        URL oracle = new URL("http://localhost:4503/content/geometrixx-outdoors/en.json");
        URLConnection yc = oracle.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(
                                    yc.getInputStream()));
        String inputLine;
        while ((inputLine = in.readLine()) != null)
            System.out.println(inputLine);
        in.close();
    }
}