code: @Override
      public boolean updatePolicy(String name, String newDocument)
      throws PolicyStoreException {
  
          String pid = this.getPID(name);
  
          if (!contains(name)) {
              throw new PolicyStoreException("Update:  policy " + pid
                                                   + " not found");
          }
  
          if (datastreamControlGroup.equals("X")) {
              // inline, modify by value
              try {
                  this.apiMService
                  .modifyDatastreamByValue(getContext(),
                                           pid,
                                           FESL_POLICY_DATASTREAM,
                                           null,
                                           null,
                                           null,
                                           null,
                                           new ByteArrayInputStream(newDocument
                                                                    .getBytes("UTF-8")),
                                                                    "DISABLED",
                                                                    null,
                                                                    "Modifying policy " + pid,
                                                                    null);
              } catch (Exception e) {
                  throw new PolicyStoreException("Update:  error modifying datastream by value for "
                                                       + pid
                                                       + " - "
                                                       + e.getMessage(),
                                                       e);
              }
  
          } else if (datastreamControlGroup.equals("M")) {
              // managed, generate temp location, modify by reference
              String dsLocation = null;
              try {
                  ByteArrayInputStream is =
                      new ByteArrayInputStream(newDocument.getBytes("UTF-8"));
                  dsLocation = apiMService.putTempStream(getContext(), is);
              } catch (Exception e) {
                  throw new PolicyStoreException("Update: error generating temp datastream location - "
                                                       + e.getMessage(),
                                                       e);
              }
              try {
                  apiMService.modifyDatastreamByReference(getContext(),
                                                          pid,
                                                          FESL_POLICY_DATASTREAM,
                                                          null,
                                                          null,
                                                          null,
                                                          null,
                                                          dsLocation,
                                                          "DISABLED",
                                                          null,
                                                          "Modifying policy "
                                                          + pid,
                                                          null);
              } catch (ServerException e) {
                  throw new PolicyStoreException("Update:  error modifying datastream by reference for "
                                                       + pid
                                                       + " - "
                                                       + e.getMessage(),
                                                       e);
              }
  
          } else {
              throw new PolicyStoreException("Update:  Invalid datastream control group "
                                                   + datastreamControlGroup + " - use M or X");
          }
  
          return true;
      }
docs: /*
  (non-Javadoc)
  @see
  org.fcrepo.server.security.xacml.pdp.data.PolicyDataManager#updatePolicy
  (java.lang.String, java.lang.String)