// Prepare Salesforce metadata metadata for repository scan
RepositoryScanResult repositoryScanResult = new RepositoryScanResult();
RepositoryItem repositoryContainer = new RepositoryItem();
repositoryContainer.repositoryItems = new ArrayList<RepositoryItem>();
repositoryScanResult.metadataFolderBySuffix = new HashMap<String, DescribeMetadataObject>();
DescribeMetadataResult metadataDescribeResult = forceConnector.getMetadataConnection().describeMetadata(29.0); // TODO: Make version configurable / auto
for(DescribeMetadataObject describeObject : metadataDescribeResult.getMetadataObjects())
{
repositoryScanResult.metadataFolderBySuffix.put(describeObject.getSuffix(), describeObject);
if(describeObject.getMetaFile())
repositoryScanResult.metadataFolderBySuffix.put(describeObject.getSuffix() + "-meta.xml", describeObject);
}