new NonExistantTemporaryFileCreator());
manager.executeWith(new TemporaryFileExecutor() {
public void execute(File file) throws Exception {
// set up
Map properties = new HashMap();
XMLRepository repository;
RepositoryConnection repositoryConnection;
if (!file.mkdirs()) {
throw new Exception("Could not create temporary directory structure for " +
file.getPath());
}
properties.put(XMLRepository.DEFAULT_PROJECT_DIRECTORY_PROPERTY,
file.getAbsolutePath());
properties.put(XMLRepository.REPLACE_DIR_PROPERTY,
new Boolean(true));
repository = XMLRepository.createRepository(properties);
repositoryConnection = repository.connect();
try {
command.execute(repositoryConnection,
repository,
file.getAbsolutePath());
} finally {
// tear down
repositoryConnection.disconnect();
repository.terminate();
}
}
});
}