53 |
|
|
54 |
try { |
try { |
55 |
String files_single[] = {"/var/log/apache2/app_access.log"}; |
String files_single[] = {"/var/log/apache2/app_access.log"}; |
56 |
String files_multi[] = {"/var/log/apache2/app_access.log.2.gz", "/var/log/apache2/app_access.log.1", "/var/log/apache2/app_access.log"}; |
String files_multi[] = {"/var/log/apache2/app_access.log.3.gz", "/var/log/apache2/app_access.log.2.gz", "/var/log/apache2/app_access.log.1", "/var/log/apache2/app_access.log"}; |
57 |
|
|
58 |
String files[]; |
String files[]; |
59 |
|
|
89 |
continue; |
continue; |
90 |
} |
} |
91 |
|
|
92 |
if (line.indexOf("latitude") == -1 ) { |
if (line.indexOf("latitude=") == -1 ) { |
93 |
continue; |
continue; |
94 |
} |
} |
95 |
|
|
96 |
|
if (line.indexOf("longitude=") == -1) { |
97 |
|
continue; |
98 |
|
} |
99 |
|
|
100 |
RequestPosition pos = new RequestPosition(); |
RequestPosition pos = new RequestPosition(); |
101 |
|
|
102 |
String toks[] = line.split(" "); |
String toks[] = line.split(" "); |
231 |
|
|
232 |
return kmlData; |
return kmlData; |
233 |
} |
} |
234 |
|
|
235 |
|
boolean enabled(String param) { |
236 |
|
if (param == null || param.equals("")) { |
237 |
|
return false; |
238 |
|
} |
239 |
|
|
240 |
|
int p = 0; |
241 |
|
try { |
242 |
|
p = Integer.parseInt(param); |
243 |
|
} catch (Exception e) {} |
244 |
|
|
245 |
|
return (p != 0); |
246 |
|
} |
247 |
|
|
248 |
@Override |
@Override |
249 |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
250 |
|
|
251 |
boolean multiple = req.getParameter("multi") != null; |
boolean multiple = enabled( req.getParameter("multi") ); |
252 |
|
|
253 |
String kmlData = getRequestsFromFile(multiple); |
String kmlData = getRequestsFromFile(multiple); |
254 |
|
|
255 |
if (req.getParameter("zip") != null) { |
if ( enabled(req.getParameter("zip")) ) { |
256 |
|
|
257 |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
258 |
|
|