105,7 → 105,7 |
|
private String build(HttpServletRequest request, String messageTitle, List<String> relativePaths, Date startDate, Date endDate,ChartTypeEnum type) |
{ |
String location = linkToFileName(relativePaths,startDate,endDate,type.getScale()); |
String location = linkToFileNameEncode(relativePaths,startDate,endDate,type.getScale(),true); |
File img = new File(Globals.TMP_DIR + location); |
if(img.exists() && ((System.currentTimeMillis() - img.lastModified()) < LINK_CHART_EXPIRE_INTERVAL)) |
{ |
195,7 → 195,7 |
String dates = sp.format(startDate) + "_UNTIL_" + sp.format(endDate) + "_" + seriesScaleEnum.getType(); |
String path; |
if(encode) |
path = URIUtil.encodeAll(relativePathName.replaceAll("/","_"),"ISO-8859-1"); |
path = URIUtil.encodePath(relativePathName.replaceAll("/","_"),"ISO-8859-1"); |
else |
path = relativePathName.replaceAll("/","_"); |
return LINK_CHART_TMP_DIR + "/" + path + "_" + dates + ".png"; |
219,7 → 219,7 |
// UrlStatService.main(null); |
AbstractDao.getCurrentSession().beginTransaction(); |
List<String> relativePaths = new ArrayList<String>(); |
relativePaths.add("/Welcome.do"); |
relativePaths.add("/public/announcements/getFlashNews.jsp?sid=0.9998549583612295"); |
// relativePaths.add("/teste2"); |
System.out.println(new ChartBuilderService().run(new TestHttpServletRequest(),relativePaths, ChartTypeEnum.weekDays)); |
System.out.println(new ChartBuilderService().run(new TestHttpServletRequest(),relativePaths, ChartTypeEnum.monthDays)); |