> +         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);

My idea was to move the description of these files from the class comment block 
to separate error messages. This is why I decided to keep these try blocks 
separate.

If you don't like the idea, I'll combine these blocks and put the description 
of the files in a common comment block.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/63/files#r17209431

Reply via email to