Package org.rhq.core.util.file

Examples of org.rhq.core.util.file.FileReverter


                    + exitValue);
                return exitValue;
            }

            // If any failures occur during upgrade, we know we need to reset rhq-server.properties
            final FileReverter serverPropFileReverter = new FileReverter(getServerPropertiesFile());
            addUndoTask(new ControlCommand.UndoTask("Reverting server properties file") {
                public void performUndoWork() throws Exception {
                    try {
                        serverPropFileReverter.revert();
                    } catch (Exception e) {
                        throw new Exception("Cannot reset rhq-server.properties - revert settings manually", e);
                    }
                }
            });
View Full Code Here


            if (oldServerEnvFile.exists()) {
                File newServerEnvFile = new File(getBaseDir(), envFile);
                File newServerEnvFileBackup = new File(getBaseDir(), (envFile + ".default"));
                try {
                    // If any failures occur during upgrade reset the env file to the default
                    final FileReverter serverEnvFileReverter = new FileReverter(newServerEnvFile);
                    addUndoTask(new ControlCommand.UndoTask("Reverting server environment file") {
                        public void performUndoWork() throws Exception {
                            try {
                                serverEnvFileReverter.revert();
                            } catch (Exception e) {
                                throw new Exception("Cannot reset rhq-server-env.sh|bat - revert manually", e);
                            }
                        }
                    });
View Full Code Here

            // If the install fails, we will remove the install marker file allowing the installer to be able to run again.
            // We also need to revert mgmt-users.properties
            File mgmtUserPropertiesFile = new File(getBaseDir(),
                "jbossas/standalone/configuration/mgmt-users.properties");
            File standaloneXmlFile = new File(getBaseDir(), "jbossas/standalone/configuration/standalone-full.xml");
            final FileReverter mgmtUserPropertiesReverter = new FileReverter(mgmtUserPropertiesFile);
            final FileReverter standaloneXmlFileReverter = new FileReverter(standaloneXmlFile);
            addUndoTask(new ControlCommand.UndoTask(
                "Removing server-installed marker file and management user and reverting to original standalone-full.xml") {
                public void performUndoWork() throws Exception {
                    getServerInstalledMarkerFile(getBaseDir()).delete();
                    mgmtUserPropertiesReverter.revert();
                    standaloneXmlFileReverter.revert();
                }
            });

            org.apache.commons.exec.CommandLine commandLine = getCommandLine("rhq-installer");
            if (ServerInstallerAction.UPGRADE == serverInstallerAction) {
View Full Code Here

                log.error("Exiting due to the previous errors");
                return RHQControl.EXIT_CODE_NOT_INSTALLED;
            }

            // If any failures occur, we know we need to reset rhq-server.properties.
            final FileReverter serverPropFileReverter = new FileReverter(getServerPropertiesFile());
            addUndoTask(new ControlCommand.UndoTask("Reverting server properties file") {
                public void performUndoWork() throws Exception {
                    try {
                        serverPropFileReverter.revert();
                    } catch (Exception e) {
                        throw new Exception("Cannot reset rhq-server.properties - revert settings manually", e);
                    }
                }
            });
View Full Code Here

TOP

Related Classes of org.rhq.core.util.file.FileReverter

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.