jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds] Fixes a windows locale bug with the "Everyone" principal (#879)
Date Tue, 17 Nov 2015 05:55:12 GMT
> +      Process pr = null;
> +      try {
> +         pr = rt.exec("whoami /groups | find \"S-1-1-0\"");
> +      } catch (IOException e) {
> +         return "Everyone";
> +      }
> +      try {
> +         pr.waitFor();
> +      } catch (InterruptedException e) {
> +         e.printStackTrace();
> +      }
> +      try ( InputStreamReader reader = new InputStreamReader(pr.getInputStream(), Charsets.UTF_8))
{
> +         return CharStreams.toString(reader).split(" ")[0];
> +      } catch (IOException e) {
> +         return "Everyone";
> +      }

Could you explain this a bit? Why do we need the three blocks here? Could this be simplified
into one block?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/879/files#r45024634
Mime
View raw message