I am using URLConnection class to read some data from a specific website where the data gewts updated everyday.We are accessing this through our proxy server.Some times when we access the site through out program we are gettgin old data where as if we access the same url form a browser we are getting latest data.
is there anyway we can get rid of this cacheing problem.
i am tryimg to open this url for 50 times just to ensure its gettgin refreshed.but no use.
InputStream stream = urlConn.getInputStream(); BufferedReader reader = new BufferedReader (new InputStreamReader(stream)); String line = reader.readLine(); dataDate = line.substring(0,8);
cat.info("sCurrBussDay:"+sCurrBussDay); cat.info("dataDat e:"+dataDate); if(sCurrBussDay.equals(dataDate)) { BufferedWriter writer = new BufferedWriter(new FileWriter(new File(local+"/"+filename))); while (line != null) { writer.write(line); writer.newLine(); line = reader.readLine(); } writer.flush(); writer.close(); reader.close(); cat.info(" fileDownload: for dataDate="+dataDate+" Today: "+processDate.substring(0,10)); iConnectionCount++; break; } else {
iConnectio nCount++; continue; }
}
cat.info("fileDownload from: "+fromurl+" save to: "+local+"/"+filename); cat.info("Total Attempts to get latestData :"+iConnectionCount); cat.info("dataDate:"+dataDate); cat.info("sCurrBussDay:"+ sCurrBussDay);