public void generateThumbnails(Map<String, Object> parameters, Writer writer) {
String baseDirectory = "photos/";
String extensions = ".jpg,.JPG,.jpeg,.JPEG,.png,.PNG";
String currentDirectory = (String) parameters.get("directory");
String thumbnailsDirectoryPath = currentDirectory + "/thumbnails/";
File thumbnailsDirectory = new DirectoriesModel(baseDirectory+thumbnailsDirectoryPath).getDirectory();
ItemsModel imagesModel = new ItemsModel(baseDirectory, currentDirectory, extensions);
if(!thumbnailsDirectory.exists()) {
thumbnailsDirectory.mkdir();
}
generateThumbnails(thumbnailsDirectory.getAbsolutePath()+"/", imagesModel.asList(), writer, currentDirectory);