Search in sources :

Example 16 with CommandLineExitException

use of com.hazelcast.simulator.utils.CommandLineExitException in project hazelcast-simulator by hazelcast.

the class WizardUtils method getProfileFile.

static File getProfileFile(String directory) {
    File zshrcFile = new File(directory, ".zshrc");
    if (zshrcFile.isFile()) {
        return zshrcFile;
    }
    File bashrcFile = new File(directory, ".bashrc");
    if (bashrcFile.isFile()) {
        return bashrcFile;
    }
    File profileFile = new File(directory, ".profile");
    if (profileFile.isFile()) {
        return profileFile;
    }
    throw new CommandLineExitException("Could not find one of .zshrc, .bashrc or .profile files" + " under directory '" + directory + "`" + " Installation not supported on this system!");
}
Also used : CommandLineExitException(com.hazelcast.simulator.utils.CommandLineExitException) FileUtils.toTextFromResourceFile(com.hazelcast.simulator.utils.FileUtils.toTextFromResourceFile) File(java.io.File) FileUtils.ensureExistingFile(com.hazelcast.simulator.utils.FileUtils.ensureExistingFile)

Aggregations

CommandLineExitException (com.hazelcast.simulator.utils.CommandLineExitException)16 File (java.io.File)6 AgentData (com.hazelcast.simulator.coordinator.registry.AgentData)3 AgentData.publicAddressesString (com.hazelcast.simulator.coordinator.registry.AgentData.publicAddressesString)2 Registry (com.hazelcast.simulator.coordinator.registry.Registry)2 BashCommand (com.hazelcast.simulator.utils.BashCommand)2 FileUtils.ensureExistingFile (com.hazelcast.simulator.utils.FileUtils.ensureExistingFile)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 AgentsFile (com.hazelcast.simulator.common.AgentsFile)1 SimulatorAddress (com.hazelcast.simulator.protocol.core.SimulatorAddress)1 FileUtils.getConfigurationFile (com.hazelcast.simulator.utils.FileUtils.getConfigurationFile)1 FileUtils.newFile (com.hazelcast.simulator.utils.FileUtils.newFile)1 FileUtils.toTextFromResourceFile (com.hazelcast.simulator.utils.FileUtils.toTextFromResourceFile)1 TagUtils.tagsToString (com.hazelcast.simulator.utils.TagUtils.tagsToString)1 UuidUtil.newUnsecureUuidString (com.hazelcast.simulator.utils.UuidUtil.newUnsecureUuidString)1 WizardUtils.copyResourceFile (com.hazelcast.simulator.wizard.WizardUtils.copyResourceFile)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 NotBoundException (java.rmi.NotBoundException)1