providedPwd = DialogUtility.askForDocumentPasswordDialog(getPanel(), inputFile.getName());
if (providedPwd != null && providedPwd.length() > 0) {
setProvidedPassword(providedPwd);
pdfDoc = openDoc(inputFile, providedPwd);
} else {
throw new ThumbnailCreationException(GettextResource.gettext(Configuration
.getInstance().getI18nResourceBundle(), "Password not provided."));
}
} else {
throw new ThumbnailCreationException(ioe);
}
}
if (pdfDoc != null) {
// require password if encrypted
// I already opened the document in visual mode but if
// encrypted it will need
// the password to manipulate
if (pdfDoc.isEncrypted() && (providedPwd == null || providedPwd.length() == 0)) {
providedPwd = DialogUtility.askForDocumentPasswordDialog(getPanel(), inputFile.getName());
setProvidedPassword(providedPwd);
}
retVal = true;
} else {
throw new ThumbnailCreationException(GettextResource.gettext(Configuration.getInstance()
.getI18nResourceBundle(), "Unable to open the document."));
}
} catch (IOException ioe) {
throw new ThumbnailCreationException(GettextResource.gettext(Configuration.getInstance()
.getI18nResourceBundle(), "Error opening pdf document")
+ " " + inputFile.getAbsolutePath(), ioe);
} catch (COSLoadException cle) {
throw new ThumbnailCreationException(GettextResource.gettext(Configuration.getInstance()
.getI18nResourceBundle(), "Error opening pdf document")
+ " " + inputFile.getAbsolutePath(), cle);
} catch (OutOfMemoryError oom) {
throw new ThumbnailCreationException(GettextResource.gettext(Configuration.getInstance()
.getI18nResourceBundle(), "Not enough memory to create thumbnails")
+ " " + inputFile.getAbsolutePath(), oom);
}
} else {
log.error(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),