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

The following examples show how to use com.bstek.ureport.provider.report.ReportFile. These examples are extracted from open source projects. 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 Project: ureport   Source File: FileReportProvider.java    License: 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 Project: opscenter   Source File: ReportProviderImpl.java    License: 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 Project: opscenter   Source File: ReportProviderImpl.java    License: 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 Project: springboot-ureport   Source File: MySQLProvider.java    License: 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 Project: springboot-ureport   Source File: FTPProvider.java    License: 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 Project: ureport   Source File: ClasspathReportProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public List<ReportFile> getReportFiles() {
	return null;
}