/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/RequestPlotter.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/RequestPlotter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1310 by torben, Tue Apr 19 16:19:45 2011 UTC revision 1311 by torben, Tue Apr 19 16:31:11 2011 UTC
# Line 61  public class RequestPlotter extends Http Line 61  public class RequestPlotter extends Http
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          }          }
# Line 350  public class RequestPlotter extends Http Line 355  public class RequestPlotter extends Http
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) );

Legend:
Removed from v.1310  
changed lines
  Added in v.1311

  ViewVC Help
Powered by ViewVC 1.1.20