/** Creates the actions. */ @Override public void createActions(MigrationContext ctx) throws MigrationException { // Config fragments for (IConfigFragment fragment : ctx.getMigrationData().get(SecurityMigrator.class).getConfigFragments()) { if (fragment instanceof ApplicationPolicyBean) { try { SecurityDomainBean appPolicy = migrateAppPolicy((ApplicationPolicyBean) fragment, ctx); ctx.getActions().addAll(createSecurityDomainCliAction(appPolicy)); } catch (CliScriptException e) { throw new MigrationException( "Migration of application-policy failed: " + e.getMessage(), e); } continue; } throw new MigrationException( "Config fragment unrecognized by " + this.getClass().getSimpleName() + ": " + fragment); } // Files to copy File as5profileDir = getGlobalConfig().getAS5Config().getProfileDir(); String as7Dir = getGlobalConfig().getAS7Config().getDir(); for (String fileName : this.fileNames) { 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, as5profileDir).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); continue; } File target = Utils.createPath(as7Dir, "standalone", "configuration", src.getName()); // Default value for overwrite => false ctx.getActions().add(new CopyFileAction(this.getClass(), src, target, false)); } }