}
private LogInfo[] getLocalLogInfo() {
String folderPath = CarbonUtils.getCarbonLogsPath();
LogInfo log = null;
ArrayList<LogInfo> logs = new ArrayList<LogInfo>();
File folder = new File(folderPath);
FileFilter fileFilter = new WildcardFileFilter(
LoggingConstants.RegexPatterns.LOCAL_CARBON_LOG_PATTERN);
File[] listOfFiles = folder.listFiles(fileFilter);
for (File file : listOfFiles) {
String filename = file.getName();
String fileDates[] = filename
.split(LoggingConstants.RegexPatterns.LOG_FILE_DATE_SEPARATOR);
String filePath = CarbonUtils.getCarbonLogsPath() + LoggingConstants.FILE_SEPARATOR
+ filename;
File logfile = new File(filePath);
if (fileDates.length == 2) {
log = new LogInfo(filename, fileDates[1], getFileSize(logfile));
} else {
log = new LogInfo(filename, LoggingConstants.RegexPatterns.CURRENT_LOG,
getFileSize(logfile));
}
if (log != null) {
logs.add(log);
}