APIs to connect to Dispatcher and Extract information | Community
Skip to main content
Level 2
October 16, 2015
Solved

APIs to connect to Dispatcher and Extract information

  • October 16, 2015
  • 1 reply
  • 581 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by 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 reply

Sham_HC
Sham_HCAccepted solution
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();
    }
}