public void modify(SSOToken token,String objName,ModificationItem[] mods) throws SMSException, SSOException {
  if ((objName == null) || (objName.length() == 0) || (mods == null)|| (mods.length == 0)) {
    throw new IllegalArgumentException("SMSFlatFileObject.modify: " + "One or more arguments is null or empty");
  }
  String objKey=objName.toLowerCase();
  String filepath=null;
  mRWLock.readRequest();
  try {
    filepath=mNameMap.getProperty(objKey);
    if (filepath == null) {
      String errmsg="SMSFlatFileObject.modify: object " + objName + " not found.";
      mDebug.error(errmsg);
      throw new ServiceNotFoundException(errmsg);
    }
  }
  finally {
    mRWLock.readDone();
  }
  mRWLock.writeRequest();
  try {
    filepath=mNameMap.getProperty(objKey);
    if (filepath == null) {
      String errmsg="SMSFlatFileObject.modify: object " + objName + " not found.";
      mDebug.error(errmsg);
      throw new ServiceNotFoundException(errmsg);
    }
    File filehandle=new File(filepath);
    if (!filehandle.isFile()) {
      String errmsg="SMSFlatFileObject.modify: Attributes file for object " + objName + " not found.";
      mDebug.error(errmsg);
      throw new ServiceNotFoundException(errmsg);
    }
    Properties props=loadProperties(filehandle,objName);
    boolean hasSunXmlKeyValue=(props.getProperty(SMSEntry.ATTR_XML_KEYVAL) == null) ? false : true;
    for (int i=0; i < mods.length; i++) {
      modifyValues(objName,mods[i],props);
    }
    saveProperties(props,filehandle,objName);
    if (!hasSunXmlKeyValue) {
      hasSunXmlKeyValue=(props.getProperty(SMSEntry.ATTR_XML_KEYVAL) == null) ? false : true;
    }
    if (hasSunXmlKeyValue) {
      deleteSunXmlKeyValFiles(filehandle.getParentFile());
      Set xmlKeyVals=toValSet(SMSEntry.ATTR_XML_KEYVAL,props.getProperty(SMSEntry.ATTR_XML_KEYVAL));
      createSunXmlKeyValFiles(filehandle.getParentFile(),xmlKeyVals);
    }
  }
  finally {
    mRWLock.writeDone();
  }
}

public void modify ( SSOToken token , String objName , ModificationItem [ ] mods ) throws SMSException , SSOException { if ( ( objName == null ) || ( objName . length ( ) == 0 ) || ( mods == null ) || ( mods . length == 0 ) ) { throw new IllegalArgumentException ( "SMSFlatFileObject.modify: " + "One or more arguments is null or empty" ) ; } String objKey = objName . toLowerCase ( ) ; String filepath = null ; mRWLock . readRequest ( ) ; try { filepath = mNameMap . getProperty ( objKey ) ; if ( filepath == null ) { String errmsg = "SMSFlatFileObject.modify: object " + objName + " not found." ; mDebug . error ( errmsg ) ; throw new ServiceNotFoundException ( errmsg ) ; } } finally { mRWLock . readDone ( ) ; } mRWLock . writeRequest ( ) ; try { filepath = mNameMap . getProperty ( objKey ) ; if ( filepath == null ) { String errmsg = "SMSFlatFileObject.modify: object " + objName + " not found." ; mDebug . error ( errmsg ) ; throw new ServiceNotFoundException ( errmsg ) ; } File filehandle = new File ( filepath ) ; if ( ! filehandle . isFile ( ) ) { String errmsg = "SMSFlatFileObject.modify: Attributes file for object " + objName + " not found." ; mDebug . error ( errmsg ) ; throw new ServiceNotFoundException ( errmsg ) ; } Properties props = loadProperties ( filehandle , objName ) ; boolean hasSunXmlKeyValue = ( props . getProperty ( SMSEntry . ATTR_XML_KEYVAL ) == null ) ? false : true ; for ( int i = 0 ; i < mods . length ; i ++ ) { modifyValues ( objName , mods [ i ] , props ) ; } saveProperties ( props , filehandle , objName ) ; if ( ! hasSunXmlKeyValue ) { hasSunXmlKeyValue = ( props . getProperty ( SMSEntry . ATTR_XML_KEYVAL ) == null ) ? false : true ; } if ( hasSunXmlKeyValue ) { deleteSunXmlKeyValFiles ( filehandle . getParentFile ( ) ) ; Set xmlKeyVals = toValSet ( SMSEntry . ATTR_XML_KEYVAL , props . getProperty ( SMSEntry . ATTR_XML_KEYVAL ) ) ; createSunXmlKeyValFiles ( filehandle . getParentFile ( ) , xmlKeyVals ) ; } } finally { mRWLock . writeDone ( ) ; } }
modify the attributes for the given configuration object .
