finally
{
IOUtils.closeQuietly(is);
}
CmdLineParser parser = new CmdLineParser(this);
parser.parse(props);
this.molgenis_properties = propertiesFile;
// parse passwordfile
String passwordFile = propertiesFile.replace(".properties", ".passwd");
this.molgenis_passwd = passwordFile;
props = new Properties();
is = null;
try
{
// try to load from local files
is = new FileInputStream(passwordFile.trim());
props.load(is);
}
catch (FileNotFoundException e)
{
InputStream is2 = ClassLoader.getSystemResourceAsStream(passwordFile.trim());
try
{
// try to load from classpath
props.load(is2);
}
catch (Exception e2)
{
// no biggie
}
finally
{
IOUtils.closeQuietly(is2);
}
}
finally
{
IOUtils.closeQuietly(is);
}
parser = new CmdLineParser(this);
parser.parse(props);
// warn if no password was provided
if ("".equals(this.db_password)) System.err.println("WARNING: db_password was not provided in neither "
+ propertiesFile + " nor " + passwordFile);