61 |
|
|
62 |
protected File[] getFiles(int count) { |
protected File[] getFiles(int count) { |
63 |
File accessLogDir = new File("/home/app/domain1/logs/access/"); |
File accessLogDir = new File("/home/app/domain1/logs/access/"); |
64 |
|
//File accessLogDir = new File("/home/torben/inst/glassfishv3/glassfish/domains/domain1/logs/access/"); |
65 |
|
|
66 |
File logFiles[] = accessLogDir.listFiles( new FilenameFilter() { |
File logFiles[] = accessLogDir.listFiles( new FilenameFilter() { |
67 |
@Override |
@Override |
68 |
public boolean accept(File dir, String name) { |
public boolean accept(File dir, String name) { |
69 |
|
//log.info("name:" + name); |
70 |
return name.startsWith("server_access_log"); |
return name.startsWith("server_access_log"); |
71 |
} |
} |
72 |
}); |
}); |
73 |
|
|
74 |
|
Arrays.sort(logFiles); |
75 |
|
|
76 |
if (logFiles == null) { |
if (logFiles == null) { |
77 |
File[] empty = {}; |
File[] empty = {}; |
78 |
|
log.info("file array was empty"); |
79 |
return empty; |
return empty; |
80 |
} |
} |
81 |
|
|
82 |
int from = logFiles.length - count; |
int from = logFiles.length - (count); |
83 |
int to = logFiles.length-1; |
int to = logFiles.length; |
84 |
|
|
85 |
return Arrays.copyOfRange(logFiles, from, to); |
return Arrays.copyOfRange(logFiles, from, to); |
86 |
} |
} |
355 |
key = "kmldata-multi"; |
key = "kmldata-multi"; |
356 |
} |
} |
357 |
|
|
358 |
kmlData = cache.get(key); |
kmlData = null;// = cache.get(key); |
359 |
|
|
360 |
if (kmlData == null) { |
if (kmlData == null) { |
361 |
kmlData = formatXml( getRequestsFromFileWorker(multiple) ); |
kmlData = formatXml( getRequestsFromFileWorker(multiple) ); |