I do see various options to enforce protection but none with a password. How would I do that?
File file = new File(fileName);
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
XWPFDocument document = new XWPFDocument(fis);
document.enforceCommentsProtection();
document.enforceFillingFormsProtection();
document.enforceReadonlyProtection();
document.enforceTrackedChangesProtection();
document.enforceUpdateFields();
document.removeProtectionEnforcement();