Class PolicyFileModel


  • public class PolicyFileModel
    extends java.lang.Object
    • Field Detail

      • LOG

        private static final Logger LOG
      • file

        private java.io.File file
      • permissionsMap

        private final java.util.Map<PolicyIdentifier,​java.util.Map<PolicyEditorPermissions,​java.lang.Boolean>> permissionsMap
        Maps Codebases to Maps of Permissions and whether that Permission is set or not. The Codebase keys correspond to the Codebases in the list UI, and the Permission->Boolean maps correspond to the checkboxes associated with each Codebase.
    • Constructor Detail

      • PolicyFileModel

        PolicyFileModel​(java.lang.String filepath)
      • PolicyFileModel

        PolicyFileModel​(java.io.File file)
      • PolicyFileModel

        PolicyFileModel()
    • Method Detail

      • setFile

        boolean setFile​(java.io.File file)
      • getFile

        java.io.File getFile()
      • openAndParsePolicyFile

        void openAndParsePolicyFile()
                             throws java.io.IOException,
                                    PolicyParser.ParsingException
        Open the file pointed to by the filePath field. This is either provided by the "-file" command line flag, or if none given, comes from DeploymentConfiguration.
        Throws:
        java.io.IOException
        PolicyParser.ParsingException
      • savePolicyFile

        void savePolicyFile()
                     throws java.io.IOException
        Save the policy model into the file pointed to by the filePath field.
        Throws:
        java.io.IOException
      • hasChanged

        boolean hasChanged()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • addIdentifier

        boolean addIdentifier​(PolicyIdentifier identifier)
        Add a new identifier. No action is taken if the identifier has already been added.
        Parameters:
        identifier - for which a permissions mapping is required
        Returns:
        true iff there was already an entry for this identifier
      • clearPermissions

        void clearPermissions()
      • clearCustomPermissions

        void clearCustomPermissions()
      • clearCustomIdentifier

        void clearCustomIdentifier​(PolicyIdentifier identifier)