> + System.err.println("Cannot open your SSH public key at " +
> sshPublicKeyFileName
> + + "\nIt is required to authorize your access to the
> machine.\n"
> + + "See
> https://developers.google.com/compute/docs/instances#sshkeys for more
> details.\n"
> + + e.getMessage());
> + System.exit(1);
> + }
> + String sshPrivateKeyFileName = System.getProperty("user.home") +
> "/.ssh/google_compute_engine";
> + String sshPrivateKey = null;
> + try {
> + sshPrivateKey = Files.toString(new File(sshPrivateKeyFileName),
> Charset.defaultCharset());
> + } catch (IOException e) {
> + System.err.println("Cannot open your SSH private key at " +
> sshPrivateKeyFileName
> + + "\nIt is required to perform any operations on your
> machine via SSH.\n"
> + + "See
> https://developers.google.com/compute/docs/instances#sshkeys for more
> details.\n"
> + + e.getMessage());
> + System.exit(1);
Any way to combine both of these try blocks, since it's basically the same
error message?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/63/files#r17208871