}
// only binary was specified
else if (Validate.empty(profile)) {
Validate.isExecutable(binary, "Firefox binary does not point to a valid executable, " + binary);
return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxBinary.class,
FirefoxProfile.class }, new Object[] { new FirefoxBinary(new File(binary)), null }, FirefoxDriver.class);
}
// only profile was specified
else if (Validate.empty(binary)) {
Validate.isValidPath(profile, "Firefox profile does not point to a valid path " + profile);
return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxProfile.class },
new Object[] { new FirefoxProfile(new File(profile)) }, FirefoxDriver.class);
}
// both were specified
else {
Validate.isValidPath(profile, "Firefox profile does not point to a valid path, " + profile);
Validate.isExecutable(binary, "Firefox binary does not point to a valid executable, " + binary);
return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { FirefoxBinary.class,
FirefoxProfile.class }, new Object[] { new FirefoxBinary(new File(binary)),
new FirefoxProfile(new File(profile)) }, FirefoxDriver.class);
}
}