protected void loadMapper() throws SMSException {
  StringBuffer nameMapFilename=new StringBuffer(mRootDir);
  nameMapFilename.append(File.separatorChar);
  nameMapFilename.append(DEFAULT_NAMEMAP_FILENAME);
  mNameMapHandle=new File(nameMapFilename.toString());
  if (mNameMapHandle.isFile()) {
    if (!mNameMapHandle.canRead()) {
      String errmsg="SMSFlatFileObject.initialize: cannot read file " + mNameMapHandle.getPath();
      mDebug.error(errmsg);
      throw new SMSException(errmsg);
    }
    mNameMap=loadProperties(mNameMapHandle,null);
  }
 else {
    try {
      mNameMapHandle.createNewFile();
    }
 catch (    IOException e) {
      String errmsg="SMSFlatFileObject.initialize: " + "cannot create file, " + nameMapFilename + ". Exception "+ e.getMessage();
      mDebug.error(errmsg);
      throw new SMSException(errmsg);
    }
catch (    SecurityException e) {
      String errmsg="SMSFlatFileObject.initialize: " + "cannot create file " + nameMapFilename + ". Exception "+ e.getMessage();
      mDebug.error(errmsg);
      throw new SMSException(errmsg);
    }
    mNameMap=new CaseInsensitiveProperties();
    try {
      create(null,mRootDN,new HashMap());
      if (mDebug.messageEnabled()) {
        mDebug.message("SMSFlatFileObject.initialize: " + "created SMS object for " + mRootDN);
      }
    }
 catch (    SSOException e) {
    }
catch (    ServiceAlreadyExistsException e) {
      if (mDebug.messageEnabled()) {
        mDebug.message("SMSFlatFileObject.initialize: " + mRootDN + " already exists");
      }
    }
    try {
      create(null,"ou=services," + mRootDN,new HashMap());
      if (mDebug.messageEnabled()) {
        mDebug.message("SMSFlatFileObject.initialize: " + "created SMS object for ou=services," + mRootDN);
      }
    }
 catch (    SSOException e) {
    }
catch (    ServiceAlreadyExistsException e) {
      if (mDebug.messageEnabled()) {
        mDebug.message("SMSFlatFileObject.initialize: " + "ou=services," + mRootDN + " already exists");
      }
    }
  }
}

protected void loadMapper ( ) throws SMSException { StringBuffer nameMapFilename = new StringBuffer ( mRootDir ) ; nameMapFilename . append ( File . separatorChar ) ; nameMapFilename . append ( DEFAULT_NAMEMAP_FILENAME ) ; mNameMapHandle = new File ( nameMapFilename . toString ( ) ) ; if ( mNameMapHandle . isFile ( ) ) { if ( ! mNameMapHandle . canRead ( ) ) { String errmsg = "SMSFlatFileObject.initialize: cannot read file " + mNameMapHandle . getPath ( ) ; mDebug . error ( errmsg ) ; throw new SMSException ( errmsg ) ; } mNameMap = loadProperties ( mNameMapHandle , null ) ; } else { try { mNameMapHandle . createNewFile ( ) ; } catch ( IOException e ) { String errmsg = "SMSFlatFileObject.initialize: " + "cannot create file, " + nameMapFilename + ". Exception " + e . getMessage ( ) ; mDebug . error ( errmsg ) ; throw new SMSException ( errmsg ) ; } catch ( SecurityException e ) { String errmsg = "SMSFlatFileObject.initialize: " + "cannot create file " + nameMapFilename + ". Exception " + e . getMessage ( ) ; mDebug . error ( errmsg ) ; throw new SMSException ( errmsg ) ; } mNameMap = new CaseInsensitiveProperties ( ) ; try { create ( null , mRootDN , new HashMap ( ) ) ; if ( mDebug . messageEnabled ( ) ) { mDebug . message ( "SMSFlatFileObject.initialize: " + "created SMS object for " + mRootDN ) ; } } catch ( SSOException e ) { } catch ( ServiceAlreadyExistsException e ) { if ( mDebug . messageEnabled ( ) ) { mDebug . message ( "SMSFlatFileObject.initialize: " + mRootDN + " already exists" ) ; } } try { create ( null , "ou=services," + mRootDN , new HashMap ( ) ) ; if ( mDebug . messageEnabled ( ) ) { mDebug . message ( "SMSFlatFileObject.initialize: " + "created SMS object for ou=services," + mRootDN ) ; } } catch ( SSOException e ) { } catch ( ServiceAlreadyExistsException e ) { if ( mDebug . messageEnabled ( ) ) { mDebug . message ( "SMSFlatFileObject.initialize: " + "ou=services," + mRootDN + " already exists" ) ; } } } }
loads the name mapper , create it if it doesn ' t exist .
