for (File file : returnedFiles){
if (file.isDirectory()){
continue;
}
if (file.getName().toLowerCase().endsWith(".shp")){
fileResources.add(new FileSystemResource(file.getAbsolutePath()));
totalSize += file.length();
} else if (file.getName().toLowerCase().endsWith(".shx")){
fileResources.add(new FileSystemResource(file.getAbsolutePath()));
totalSize += file.length();
} else if (file.getName().toLowerCase().endsWith(".dbf")){
fileResources.add(new FileSystemResource(file.getAbsolutePath()));
totalSize += file.length();
}
}
logger.info("Total file size (in MB) equals: " + Double.toString(totalSize/1048576.0));