moved config dir creation to to masterscache

This commit is contained in:
David Ribeiro Alves 2012-03-08 04:15:41 +00:00
parent e915fd3e7b
commit 176a8b3b3c
3 changed files with 9 additions and 8 deletions

View File

@ -77,10 +77,6 @@ public class VirtualBoxPropertiesBuilder extends PropertiesBuilder {
properties.put(VIRTUALBOX_WORKINGDIR, workingDir);
if (!new File(workingDir).exists()) {
new File(workingDir, "isos").mkdirs();
}
String yamlDescriptor = System.getProperty("test.virtualbox.image.descriptor.yaml", VIRTUALBOX_WORKINGDIR
+ File.separator + "images.yaml");

View File

@ -33,6 +33,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ExecutionException;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
@ -109,6 +110,13 @@ public class MastersCache extends AbstractLoadingCache<Image, Master> {
this.isoDownloader = isoDownloader;
}
@PostConstruct
public void createCacheDirStructure() {
if (!new File(workingDir).exists()) {
new File(workingDir, "isos").mkdirs();
}
}
@Override
public synchronized Master get(Image key) throws ExecutionException {
// check if we have loaded this machine before

View File

@ -138,10 +138,7 @@ public class BaseVirtualBoxClientLiveTest extends BaseVersionedServiceLiveTest {
imageId = "ubuntu-11.04-server-i386";
isosDir = workingDir + File.separator + "isos";
File isosDirFile = new File(isosDir);
if (!isosDirFile.exists()) {
isosDirFile.mkdirs();
}
hostVersion = Iterables.get(Splitter.on('r').split(context.getProviderSpecificContext().getBuildVersion()), 0);
operatingSystemIso = String.format("%s/%s.iso", isosDir, imageId);
guestAdditionsIso = String.format("%s/VBoxGuestAdditions_%s.iso", isosDir, hostVersion);