public void generateThumbnails(
final String fileNamePrefix,
final InputStream inputStream,
final String contentType,
final String thumbnailsLocation) {
ThumbnailGenerator thumbnailGenerator = thumbnailGenerators.get(contentType);
thumbnailGenerator = thumbnailGenerator != null ? thumbnailGenerator
: defaultThumbnailGenerator;
if (thumbnailGenerator != null) {
Object hint = null;
for (int dimension : supportedSizes) {
File fileOut = new File(thumbnailsLocation, fileNamePrefix + dimension + generatedExtension);
try {
if (log.isDebugEnabled()) {
log.debug("Checking user account picture folder "+fileOut.getAbsolutePath());
log.debug("Checking user account picture folder "+fileOut.exists());
}
if (!fileOut.exists()) {
log.debug("Creating user account picture folder");
fileOut.mkdirs();
log.debug("Checking user account picture folder "+fileOut.exists());
}
hint = thumbnailGenerator.createThumbnail(inputStream,
fileOut, dimension, hint);
log.debug("Generated thumbnail for: " + inputStream
+ " in " + fileOut + " for type " + contentType);
} catch (Exception e) {
log.error("Error generating thumbnail for: " + inputStream