Merge pull request #947 from andrewgaul/virtualbox-remove-commons-io

Remove commons-io dependency from virtualbox
This commit is contained in:
Adrian Cole 2012-11-03 11:47:43 -07:00
commit 10ab929097
3 changed files with 4 additions and 9 deletions

View File

@ -76,11 +76,6 @@
<artifactId>jetty-server</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-sshj</artifactId>

View File

@ -28,7 +28,7 @@ import java.io.InputStreamReader;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.commons.io.IOUtils;
import org.jclouds.util.Strings2;
import org.jclouds.virtualbox.config.VirtualBoxConstants;
import com.google.common.base.Charsets;
@ -58,7 +58,7 @@ public class YamlImagesFromFileConfig implements Supplier<String> {
String yamlDesc = null;
// if the yaml file does not exist just use default-images.yaml
if (!yamlFile.exists()) {
yamlDesc = IOUtils.toString(new InputStreamReader(getClass().getResourceAsStream("/default-images.yaml")));
yamlDesc = Strings2.toStringAndClose(getClass().getResourceAsStream("/default-images.yaml"));
} else {
yamlDesc = Files.toString(yamlFile, Charsets.UTF_8);
}

View File

@ -25,8 +25,8 @@ import java.net.URL;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.jclouds.compute.domain.Image;
import org.jclouds.util.Strings2;
import org.jclouds.virtualbox.config.VirtualBoxConstants;
import org.jclouds.virtualbox.domain.YamlImage;
import org.jclouds.virtualbox.functions.YamlImagesFromFileConfig;
@ -59,7 +59,7 @@ public class PreseedCfgServerTest {
starter.start(preconfigurationUrl, getDefaultImage().preseed_cfg);
String preseedFileFromJetty = IOUtils.toString(new URL("http://127.0.0.1:" + port + "/preseed.cfg").openStream());
String preseedFileFromJetty = Strings2.toStringAndClose(new URL("http://127.0.0.1:" + port + "/preseed.cfg").openStream());
String preseedFileFromFile = getDefaultImage().preseed_cfg + lineSeparator;
assertEquals(preseedFileFromFile, preseedFileFromJetty);