Package org.pomizer.wrapper

Examples of org.pomizer.wrapper.DeployerChangeSet


    private static void revertFiles(final String configurationFileName) {
       
        try {
            JavaUtils.printToConsole("Loading configuration file...");
           
            DeployerChangeSet changeset = new DeployerChangeSet(configurationFileName);
            changeset.load();
           
            if (0 == changeset.getSize()) {
                JavaUtils.printToConsole("No changes found");
            }
            else {
           
                final Document configurationXmlDocument = XmlUtils.loadXmlDocument(configurationFileName);
               
                List<String> postProcessCallUrls = new ArrayList<String>();
                List<DeployerCommandInfo> postProcessCallCommands = new ArrayList<DeployerCommandInfo>();
               
                DeployerProjectUtils.loadPostProcessCallUrls(configurationXmlDocument, postProcessCallUrls);
                DeployerProjectUtils.loadPostProcessCommands(configurationXmlDocument, postProcessCallCommands);
               
                JavaUtils.printToConsole("Reverting changes...");
                final List<String> changedFiles = new ArrayList<String>();
                final List<File> filesToDelete = new ArrayList<File>();
               
                for (int i = 0; i < changeset.getSize(); i++) {
                    final String changedFileName = changeset.getPath(i);
                    if (-1 == changedFiles.indexOf(changedFileName)) {
                        changedFiles.add(changedFileName);
                    }
                   
                    final String backupFileName = changeset.getBackupPath(i);
                   
                    JavaUtils.printToConsole("  reverting \"" + changedFileName + "\"...");
                    final File changedFile = new File(changedFileName);
                    if (StringUtils.isNullOrEmptyOrBlank(backupFileName)) {
                        filesToDelete.add(changedFile);
                    }
                    else {
                        final File backupFile = new File(backupFileName);
                        filesToDelete.add(backupFile);
                        FileUtils.copyFile(backupFile, changedFile);
                    }
                }
                changeset.delete();
               
                for (File file : filesToDelete) {
                    if (file.exists()) {
                        file.delete();
                    }
View Full Code Here


            List<DeployerCommandInfo> postProcessCallCommands = new ArrayList<DeployerCommandInfo>();
           
            Map<String, Map<String, String>> jarsToDeploy =
                    new HashMap<String, Map<String, String>>();
            Map<String, List<String>> filesToDeploy = new HashMap<String, List<String>>();
            DeployerChangeSet changeset = new DeployerChangeSet(configurationFileName);
            changeset.load();
           
            DeployerProjectUtils.loadSettingsSection("/deployer/settings", configurationXmlDocument, globalSettings);
            DeployerProjectUtils.loadProjectsSection(projects, configurationXmlDocument, globalSettings);
            DeployerProjectUtils.loadCopySection(configurationXmlDocument, filesToDeploy);
            DeployerProjectUtils.loadPostProcessCallUrls(configurationXmlDocument, postProcessCallUrls);
View Full Code Here

TOP

Related Classes of org.pomizer.wrapper.DeployerChangeSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.