Skip to content
Permalink
Browse files
Prefer Guava IO helpers
  • Loading branch information
gaul committed Apr 8, 2014
1 parent 5f644ba commit a280fcf73344c09f91cac97fb46d94e822692b87
Showing 1 changed file with 3 additions and 4 deletions.
@@ -35,7 +35,7 @@
import static org.jclouds.scriptbuilder.domain.Statements.exec;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
@@ -72,7 +72,6 @@
import org.jclouds.compute.domain.Image;
import org.jclouds.compute.domain.ComputeMetadata;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.util.Strings2;

/**
* Demonstrates the use of {@link ComputeService}.
@@ -249,8 +248,8 @@ public static void main(String[] args) {

private static String getPrivateKeyFromFile(String filename) {
try {
return Strings2.toStringAndClose(new FileInputStream(filename));
} catch (java.io.IOException e) {
return Files.toString(new File(filename), Charsets.UTF_8);
} catch (IOException e) {
System.err.println("Exception reading private key from '%s': " + filename);
e.printStackTrace();
System.exit(1);

0 comments on commit a280fcf

Please sign in to comment.