Strabon

changeset 230:1849dd7b408f

We are writing Java 1.6, thus we are using GENERICS
author Babis Nikolaou <charnik@di.uoa.gr>
date Sat Jun 02 19:25:04 2012 +0300 (2012-06-02)
parents 0077ec91f90b
children 97c7efb8a600
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Sat Jun 02 19:21:19 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Sat Jun 02 19:25:04 2012 +0300
     1.3 @@ -225,16 +225,16 @@
     1.4  			String basePath = context.getRealPath("/") + "/../ROOT/tmp/"; 
     1.5  			String extension = (hive.format.equalsIgnoreCase("KMLMAP") ? "kml" : "kmz");
     1.6  
     1.7 -			
     1.8  			try{
     1.9  				Date date = new Date();
    1.10  
    1.11  				FileUtils.forceMkdir(new File(basePath));
    1.12  
    1.13 -				Iterator it = FileUtils.iterateFiles(new File(basePath), null, false);
    1.14 +				@SuppressWarnings("unchecked")
    1.15 +				Iterator<File> it = FileUtils.iterateFiles(new File(basePath), null, false);
    1.16  				while(it.hasNext()){
    1.17 -					File tbd = new File(((File) it.next()).getAbsolutePath());
    1.18 -					if (FileUtils.isFileOlder( new File(tbd.getAbsolutePath()), date.getTime())){
    1.19 +					File tbd = new File((it.next()).getAbsolutePath());
    1.20 +					if (FileUtils.isFileOlder(new File(tbd.getAbsolutePath()), date.getTime())){
    1.21  						FileUtils.forceDelete(new File(tbd.getAbsolutePath()));
    1.22  					}
    1.23  				}