use of ambit2.base.external.ShellException in project ambit-mirror by ideaconsult.
the class ShellBalloonWeb method getBalloonHome.
@Override
protected String getBalloonHome() throws ShellException {
try {
AMBITConfigProperties properties = new AMBITConfigProperties();
String wheredragonlives = properties.getPropertyWithDefault(ShellBalloon.BALLOON_HOME, AMBITConfigProperties.ambitProperties, null);
if (wheredragonlives == null)
throw new ShellException(null, String.format("Can't find where Balloon is located. No property %s in %s", ShellBalloon.BALLOON_HOME, AMBITConfigProperties.ambitProperties));
return wheredragonlives;
} catch (ShellException x) {
throw x;
} catch (Exception x) {
throw new ShellException(null, x);
}
}
use of ambit2.base.external.ShellException in project ambit-mirror by ideaconsult.
the class ShellBalloon method initialize.
@Override
protected void initialize() throws ShellException {
super.initialize();
String balloon_home = getBalloonHome();
File exe = new File(String.format("%s%s%s", balloon_home, File.separator, BALLOON_EXE));
File winexe = new File(String.format("%s%s%s.exe", balloon_home, File.separator, BALLOON_EXE));
if (!exe.exists() && !winexe.exists()) {
throw new ShellException(this, String.format("%s does not exist! Have you set %s environment variable?", exe.getAbsolutePath(), BALLOON_HOME));
}
addExecutable(CommandShell.os_WINDOWS, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_WINDOWSVISTA, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_WINDOWS7, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_FreeBSD, exe.getAbsolutePath(), null);
addExecutable(CommandShell.os_LINUX, exe.getAbsolutePath(), null);
setOutputFile(getOutputFileName());
setInputFile(outputFile.replace("o_bln", "i_bln"));
setReadOutput(true);
}
use of ambit2.base.external.ShellException in project ambit-mirror by ideaconsult.
the class CommandShell method getHomeFromConfig.
public synchronized String getHomeFromConfig(String propertiesResource, String propertyHome) throws ShellException {
try {
AMBITConfigProperties properties = new AMBITConfigProperties();
String wheredragonlives = properties.getPropertyWithDefault(propertyHome, propertiesResource, null);
if (wheredragonlives == null) {
logger.log(Level.SEVERE, String.format("Can't find where %s is located. No property %s in %s", toString(), propertyHome, propertiesResource));
throw new ShellException(null, String.format("Can't find where %s is located.", toString()));
}
return wheredragonlives;
} catch (ShellException x) {
throw x;
} catch (Exception x) {
throw new ShellException(null, x);
}
}
use of ambit2.base.external.ShellException in project ambit-mirror by ideaconsult.
the class OpenBabelAbstractShell method initialize.
@Override
protected void initialize() throws ShellException {
super.initialize();
String obabel_home = getOBabelHome();
File exe = new File(String.format("%s/%s", obabel_home, OBABEL_EXE));
File winexe = new File(String.format("%s/%s.exe", obabel_home, OBABEL_EXE));
if (!exe.exists() && !winexe.exists()) {
throw new ShellException(this, String.format("%s does not exist! Have you set %s environment variable?", exe.getAbsolutePath(), OBABEL_HOME));
}
addExecutable(CommandShell.os_WINDOWS, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_WINDOWSVISTA, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_WINDOWS7, winexe.getAbsolutePath(), null);
addExecutable(CommandShell.os_FreeBSD, exe.getAbsolutePath(), null);
addExecutable(CommandShell.os_LINUX, exe.getAbsolutePath(), null);
setInputFile(null);
setOutputFile(getOutputFileName());
setReadOutput(true);
}
use of ambit2.base.external.ShellException in project ambit-mirror by ideaconsult.
the class OpenBabelGen3D method getOBabelHome.
@Override
protected String getOBabelHome() throws ShellException {
try {
AMBITConfigProperties properties = new AMBITConfigProperties();
String wheredragonlives = properties.getPropertyWithDefault(OpenBabelGen3D.OBABEL_HOME, AMBITConfigProperties.ambitProperties, null);
if (wheredragonlives == null)
throw new ShellException(null, String.format("Can't find where OpenBabel is located. No property %s in %s", OpenBabelGen3D.OBABEL_HOME, AMBITConfigProperties.ambitProperties));
return wheredragonlives;
} catch (ShellException x) {
throw x;
} catch (Exception x) {
throw new ShellException(null, x);
}
}
Aggregations