Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
This conversation has been locked due to inactivity. Please create a new post.
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
Solved! Go to Solution.
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(); }}
View solution in original post
Views
Likes
Replies