} catch (IOException e) {
throw new IOException("Error reading configuration file", e);
}
if (properties.getProperty("platformlayer.username") == null) {
throw new CliException("User property not set in configuration file");
}
if (debug) {
client = buildPlatformLayerClient(properties, debug);
} else {
String propertiesKey = PropertyUtils.serialize(properties);
try {
client = platformLayerClientCache.get(propertiesKey, new Callable<HttpPlatformLayerClient>() {
@Override
public HttpPlatformLayerClient call() throws Exception {
return buildPlatformLayerClient(properties, false);
}
});
} catch (ExecutionException e) {
throw new CliException("Error building platformlayer client", e);
}
}
} finally {
if (is != System.in) {
Closeables.closeQuietly(is);