com.bstek.ureport.provider.report.ReportFile Java Examples

The following examples show how to use com.bstek.ureport.provider.report.ReportFile. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FileReportProvider.java    From ureport with Apache License 2.0 6 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	File file=new File(fileStoreDir);
	List<ReportFile> list=new ArrayList<ReportFile>();
	for(File f:file.listFiles()){
		Calendar calendar=Calendar.getInstance();
		calendar.setTimeInMillis(f.lastModified());
		list.add(new ReportFile(f.getName(),calendar.getTime()));
	}
	Collections.sort(list, new Comparator<ReportFile>(){
		@Override
		public int compare(ReportFile f1, ReportFile f2) {
			return f2.getUpdateDate().compareTo(f1.getUpdateDate());
		}
	});
	return list;
}
 
Example #2
Source File: ReportProviderImpl.java    From opscenter with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
private List<ReportFile> createReportFileList(List<Map<String,Object>> list){
	List<ReportFile> reportFileList = new ArrayList<ReportFile>();
	for (Iterator iterator = list.iterator(); iterator.hasNext();) {
		Map<String, Object> map = (Map<String, Object>) iterator.next();
		String name = String.valueOf(map.get("name"));
		Date  updateDate = (Date)map.get("updateDate");
		reportFileList.add(new ReportFile(name, updateDate));
	}
	return reportFileList;
}
 
Example #3
Source File: ReportProviderImpl.java    From opscenter with Apache License 2.0 5 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	try {
		List<Map<String, Object>> files = jdbcTemplate.queryForList(this.queryList);
		return createReportFileList(files);
	} catch (Exception e) {
		System.out.println(e.getMessage());
		return null;
	}
}
 
Example #4
Source File: MySQLProvider.java    From springboot-ureport with Apache License 2.0 5 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	List<UreportFileEntity> list = ureportFileMapper.queryReportFileList();
	List<ReportFile> reportList = new ArrayList<>();
	for (UreportFileEntity ureportFileEntity : list) {
		reportList.add(new ReportFile(ureportFileEntity.getName(), ureportFileEntity.getUpdateTime()));
	}
	return reportList	;
}
 
Example #5
Source File: FTPProvider.java    From springboot-ureport with Apache License 2.0 5 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	List<FTPFile> fileList = ftpUtils.getFileList(basePath);
	List<ReportFile> reportFile = new ArrayList<>();
	for (FTPFile ftpFile : fileList) {
		Calendar timestamp = ftpFile.getTimestamp();
		reportFile.add(new ReportFile(ftpFile.getName(), timestamp.getTime()));
	}
	return reportFile;
}
 
Example #6
Source File: ClasspathReportProvider.java    From ureport with Apache License 2.0 4 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	return null;
}