encoding = document.getEncoding();
// Write to either HJT or XML
JreepadWriter writer;
if(fileType == JreepadPrefs.FILETYPE_XML)
writer = new XmlWriter();
else if (fileType == JreepadPrefs.FILETYPE_XML_ENCRYPTED)
{
String password = document.getPassword();
if (password == null || askForFilename)
password = PasswordDialog.showPasswordDialog(true);
if (password == null)
{
successful = false; // "Cancel" was pressed
return;
}
EncryptedWriter encryptedWriter = new EncryptedWriter(new XmlWriter());
encryptedWriter.setPassword(password);
writer = encryptedWriter;
document.setPassword(password);
}
else