[rfc][icedtea-web][policyeditor] File Changed check
Jiri Vanek
jvanek at redhat.com
Wed Mar 12 10:04:49 UTC 2014
On 03/10/2014 08:57 PM, Andrew Azores wrote:
> Hi,
>
> As promised, here's a patch that lets PolicyEditor detect when the policy file has been externally
> modified since it was opened, using MD5SumWatcher.
>
> ChangeLog:
> Added check for external file modification to PolicyEditor
> * netx/net/sourceforge/jnlp/resources/Messages.properties: (PEFileModified,
> PEFileModifiedDetail) new messages
> * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java:
> (updateCheckboxes) avoid NPE. (openAndParsePolicyFile, savePolicyFile) use
> MD5SumWatcher to detect when the policy file has been externally modified.
> (updateMd5WithDialog) new method
> * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java:
> all URLs changed to example.com
>
> Thanks,
>
final int response = updateMd5WithDialog();
+ switch (response) {
+ case JOptionPane.YES_OPTION:
+ openAndParsePolicyFile();
+ return;
+ case JOptionPane.NO_OPTION:
+ break;
+ case JOptionPane.CANCEL_OPTION:
+ return;
+ default:
+ break;
+ }
What happens with gui in case of yes?
eg - I have something selected, click save, md5 warning jump out, I click reload, underlyiing policy
file reload, and my gui? Will the selected boxes/ceodebases whatever remain as I have selected, or
as it in new file? Not sure what is better here - but probably to rest gui to match new file.
Does it openAndParsePolicyFile ?
If so ok to head..
Otherwise probbaly ok to head after answer.
J.
More information about the distro-pkg-dev
mailing list