src/main/java/org/jboss/loom/migrators/security/SecurityMigrator.java
private  CopyFileAction createCopyActionForFile(SecurityMigResource resource, String fileName ) {

        if( ! resource.getFileNames().add(fileName) ) return null;

        File src;
        try {
            // TODO: MIGR-54 The paths in AS 5 config relate to some base dir. Find out which and use that, instead of searching.
            //       Then, create the actions directly in the code creating this "files to copy" collection.
            src = Utils.searchForFile(fileName, getGlobalConfig().getAS5Config().getProfileDir()).iterator().next();
        } catch( CopyException ex ) {
            //throw new ActionException("Failed copying a security file: " + ex.getMessage(), ex);
            // Some files referenced in security may not exist. (?)
            log.warn("Couldn't find file referenced in AS 5 security config: " + fileName);
            return null;
        }

        File target = Utils.createPath(getGlobalConfig().getAS7Config().getConfigDir(), src.getName());
        CopyFileAction action = new CopyFileAction( this.getClass(), src, target, CopyFileAction.IfExists.WARN );

        return action;
    }
/**
     * Creates CopyFileAction for File referenced in migrated Module-Options
     *
     * @param resource helping class containing all resources of the SecurityMigrator
     * @param fileName  file, which should be copied into AS7
     * @return  If the file is already set for copying then null else the created CopyFileAction
     */
Creates CopyFileAction for File referenced in migrated Module-Options
@param resource helping class containing all resources of the SecurityMigrator
@param fileName  file, which should be copied into AS7
@return  If the file is already set for copying then null else the created CopyFileAction
Creates CopyFileAction for File referenced in migrated Module - Options @param resource helping class containing all resources of the SecurityMigrator @param fileName file which should be copied into AS7 @return If the file is already set for copying then null else the created CopyFileAction
private  CopyFileAction createCopyActionForFile(SecurityMigResource resource, String fileName ) {
        if( ! resource.getFileNames().add(fileName) ) return null;
        File src;
        try {
            src = Utils.searchForFile(fileName, getGlobalConfig().getAS5Config().getProfileDir()).iterator().next();
        } catch( CopyException ex ) {
            log.warn("Couldn't find file referenced in AS 5 security config: " + fileName);
            return null;
        }
        File target = Utils.createPath(getGlobalConfig().getAS7Config().getConfigDir(), src.getName());
        CopyFileAction action = new CopyFileAction( this.getClass(), src, target, CopyFileAction.IfExists.WARN );
        return action;
    }
private CopyFileAction createCopyActionForFile ( SecurityMigResource resource , String fileName ) { if ( ! resource . getFileNames ( ) . add ( fileName ) ) return null ; File src ; try { src = Utils . searchForFile ( fileName , getGlobalConfig ( ) . getAS5Config ( ) . getProfileDir ( ) ) . iterator ( ) . next ( ) ; } catch ( CopyException ex ) { log . warn ( "Couldn't find file referenced in AS 5 security config: " + fileName ) ; return null ; } File target = Utils . createPath ( getGlobalConfig ( ) . getAS7Config ( ) . getConfigDir ( ) , src . getName ( ) ) ; CopyFileAction action = new CopyFileAction ( this . getClass ( ) , src , target , CopyFileAction . IfExists . WARN ) ; return action ; }
Creates CopyFileAction for File referenced in migrated Module-Options
 @param resource helping class containing all resources of the SecurityMigrator
 @param fileName  file, which should be copied into AS7
 @return  If the file is already set for copying then null else the created CopyFileAction
Creates CopyFileAction for File referenced in migrated Module - Options @param resource helping class containing all resources of the SecurityMigrator @param fileName file which should be copied into AS7 @return If the file is already set for copying then null else the created CopyFileAction
// TODO: MIGR-54 The paths in AS 5 config relate to some base dir. Find out which and use that, instead of searching. //       Then, create the actions directly in the code creating this "files to copy" collection. //throw new ActionException("Failed copying a security file: " + ex.getMessage(), ex); // Some files referenced in security may not exist. (?)