code: private List<PermissionFactory> parsePermissions(final VirtualFile file, final ModuleLoader loader, final ModuleIdentifier identifier)
              throws DeploymentUnitProcessingException {
  
          InputStream inputStream = null;
          try {
              inputStream = file.openStream();
              final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
              XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(inputStream);
              return PermissionsParser.parse(xmlReader, loader, identifier);
          } catch (Exception e) {
              throw new DeploymentUnitProcessingException(e.getMessage(), e);
          } finally {
              try {
                  if (inputStream != null) {
                      inputStream.close();
                  }
              } catch (IOException e) {
              }
          }
      }
docs: <p>
  Parses the permissions declared in the specified file. The permissions are wrapped in factory objects so they can
  be lazily instantiated after the deployment unit module has been created.
  </p>
  
  @param file the {@link VirtualFile} that contains the permissions declarations.
  @param loader the {@link ModuleLoader} that is to be used by the factory to instantiate the permission.
  @param identifier the {@link ModuleIdentifier} that is to be used by the factory to instantiate the permission.
  @return a list of {@link PermissionFactory} objects representing the parsed permissions.
  @throws DeploymentUnitProcessingException if an error occurs while parsing the permissions.